Home how to restore and backup database in android using PHP REST API
Reply: 0

how to restore and backup database in android using PHP REST API

Crys
1#
Crys Published in 2018-02-14 06:35:19Z

Need help

I'm using rest api, how can i backup or export database in my android app using php?i want to download that in my android app as txt or csv .. i'm interested in the backend process which is php..any sample code?

$qur = mysqli_query($this->con, "SELECT * FROM tbl_brands");
 //Enable to download this file 
filename = "sampledata.csv"; 
header("Content-Disposition: attachment; filename=\"$filename\"");
header("Content-Type: text/csv"); 
$display = fopen("php://output", 'w'); ]
$flag = false; 
while($row = mysqli_fetch_assoc($qur)) 
{ 
  if(!$flag) 
   { // display field/column names as first row 
      fputcsv($display, array_keys($row), ",", '"'); 
      $flag = true; 
   } 
  fputcsv($display, array_values($row), ",", '"'); 
} 
fclose($display); 
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.301854 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO