Re: How do I make all columns line up in the same row?
So the final code would look like this?
$fp = fopen('csvdir/formdata.csv','w');
$q =
"SELECT c.Orderid, c.shipfname, c.shiplname, c.shipcompany, c.shipaddress*. o.Orderid, o.orderdate, o.ordertime, o.ShipType, o.ShipService, o.ShipCost*, i.OrderidA, i.Item, i.Description*
FROM customer c
INNER JOIN orders o USING (Orderid)
INNER JOIN item i USING (OrderidA)";
$query = "mysql_query($q)";
$cols = "mysql_num_fields($query)";
while ($row = "mysql_fetch_array($query)") {
$nextline = "";
for($i = 0; $i < $cols; $i++) {
$nextline += $row[ $i ] . ($i < $cols ? ", " : "");
}
fwrite($fp,$nextline);
}