Export csv to folder?

QuestionsExport csv to folder?
Mario asked 7 years ago

Is it possible with phpgrid to export fresh data to csv to a folder on the server?

1 Answers
selectcase.biz answered 7 years ago

I solved it with:


$host = "localhost";
$dbname = DB_DATABASE;

// open connection to mysql database
$connection = mysqli_connect($host, $username, $password, $dbname) or die("Connection Error " . mysqli_error($connection));

// fetch mysql table rows
$sql = "select * from plusinfo_intraship";
$result = mysqli_query($connection, $sql) or die("Selection Error " . mysqli_error($connection));

$fp = fopen('delisprint.csv', 'w');

while($row = mysqli_fetch_assoc($result))
fputcsv($fp, $row);


//close the db connection

Your Answer

5 + 0 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.

How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?