write to file question, rewritten
| From: | mayo | Date: | Wed, 01 Jun 2005 23:01:47 +0000 |
| Subject: | write to file question, rewritten | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-216183@lists.php.net to get a copy of this message | ||
I'm trying to write the results of a mysql_fetch_array db query to a
file and am unable to.
I'm putting the results into a variable $fileContent and then using
fwrite().
I would have liked to do something like:
$filecontent =
.
$result = mysql_query( "
SELECT orderedItems.*, items.*
FROM orderedItems, items
WHERE
orderedItems.orderID=$orderID[0] AND
orderedItems.itemID=items.itemsID
");
while($row = mysql_fetch_array( $result ))
{
$theItemID=$row["orderedItems.itemID"];
$theItemPrice=$row["itemPrice"];
$theItemQty=$row["itemQty"];
$thisItemID= sprintf("% 6d",$theItemID);
$thisItemPrice= sprintf("%7.2f",$theItemPrice);
$thisItemQty= sprintf("% 7d",$theItemQty);
$thisOrder .
$thisItemID .
$thisItemPrice .
$thisItemQty .
}
"; // end of $filecontent
but that doesn't work.
Mayo