Re: How do I make all columns line up in the same row?
It seems as though the problem is not with the amount of data, as I have tested the code using only one item from one mysql table as so and it still makes a time out error:
$fp = fopen('csvdir/formdata.csv','w');
$q =
"SELECT customer.Orderid";
$query = "mysql_query($q)";
$cols = "mysql_num_fields($query)";
while ($row = "mysql_fetch_array($query)") {
$nextline = "";
for($i = 0; $i < $cols; $i++) {
// Use .= tather than += so PHP doesn't try to add numerics
$nextline .= $row[ $i ] . ($i < $cols ? ", " : "");
}
fwrite($fp,$nextline);
}
fclose($fp);
So, I'm thinking its a problem with the code. The JOIN part of the code is correct I think, but I am just having problems writing the columns specified in the JOIN onto the csv file. All the code below the SELECT query needs to be checked because I think its causing the time out error.
Edited 2 time(s). Last edit at 03/14/2006 11:02PM by Dane Iracleous.