write to file question, rewritten

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
 
 

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux