Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

simple sql query question


andymin

Recommended Posts

Posted

well, i'm assuming it is simple...

 

i would like to query my database via phpMyAdmin and then export the results as an excel/csv file

 

how can i get the customers name, order total, date purchased (just like on the orders.php in admin)

 

any help would be appreciated

 

regards

 

andy

Posted

Do you know how to write to a file? If so then just query the DB and use something like:

 

$csv = $query_results['value_1'] . ', ' . $query_results['value_2'] . ', ' . $query_results['value_3'];

 

and then write the $csv varialbe to the file. Does this make sense?

Chris Sullivan

Posted

Hi, thanks for the reply, probably need a little more help if possible,

 

tried something like:

 

<?php

$csv = $query_results['customers'] . ', ' . $query_results['orders_total'];

?>

<html>

<body>

<?php echo $csv['customers'];?>

<?php echo $csv['orders_total'];?>

</body>

</html>

 

regards

 

Andrew

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...