I am having problems outputting an array to file. The array is the result of a query on my database.
Ideally I would like to create a CSV.
This is the code which I am currently at :-
if($fh)
{
// this section controls output
$result2 = DBquery("SELECT * FROM tickets WHERE TicketID='$_POST[TicketID]'", $db);
$row = DBfetch_array($result2);
$line = explode($row, "|");
fwrite($fh, "Name: $line[0], Email: $line[1]");
//$content = serialize($row);
//fwrite ($fh, $content);
fclose($fh);
}
Any ideas would be really grateful. I can't seemm to find an example.
Emma