exporting all fields
Hi, I wanted to find out, from the below code (which works perfectly for 1 fieldname) How can I modify it so that it exports ALL fields in a table? the code line I am referring to is
$row = array($rows->getColumnVal("ProductSKU"));
So I need to edit the above so that it will export all the fields columns.
<?php require_once('../Connections/ecartdb.php'); ?>
<?php require_once('../webassist/mysqli/rsobj.php'); ?>
<?php
header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename=files/products.csv');
$output = fopen('php://output', 'w');
$rows = new WA_MySQLi_RS("rows",$ecartdb,0);
$rows->setQuery("SELECT * FROM products Where ProductBrand='libra'");
$rows->execute();
while(!$rows->atEnd()) {
$row = array($rows->getColumnVal("ProductSKU"));
fputcsv($output, $row);
$rows->moveNext();
}
$rows->moveFirst(); //return RS to first record
?>
Chris