nimzie Posted October 30, 2007 Share Posted October 30, 2007 I'm processing data from a DB as: require '../php/config.php'; require '../php/opendb.php'; $content_file = ""; $content_file .= "OrderID|ClientCustomerID|ShipEmail|ShipBusinessName|ShipName|ShipAddress1|ShipAddress2|ShipCity|ShipState|ShipZip|ShipCountry|ShipPhone|". "ShipResidentialFlag|ShipMethod|OrderDate|ProductID|ProductName|UnitPrice|Quantity|ShipComment|GiftMessage|BillBusinessName|BillName|". "BillAddress1|BillAddress2|BillCity|BillState|BillZip|BillCountry|PaymentTerms|RequestedShipDate|CancelDate|PONumber \r\n"; $sql = 'select * from origin'; $statement = mysql_query($sql); while($row = mysql_fetch_array($statement)) { $content_file .= $row['OrderID'] . '|' . $row['CustomerID'] . '|' . $row['ShipEmail'] . '|' . $row['ShipCompany'] . '|' . $row['ShipFirstName'] . ' ' . $row['ShipLastName'] . '|' . $row['ShipAddress'] . '|' . //Ship Address 2 is not present in our source file - we will make this always blank ' ' . '|' . $row['ShipCity'] . '|' . $row['ShipState'] . '|' . $row['ShipZip'] . '|' . $row['ShipCountry'] . '|' . $row['ShipPhone'] . '|' . //Setting the residential flag to yes by default **move to options 'Y' . '|' . $row['ShippingMethod'] . '|' . $row['OrderDate'] . '|' . //Assuming this is the product ID Capacity will require $row['ItemID'] . '|' . $row['ItemName'] . '|' . $row['ItemPrice'] . '|' . $row['Quantity'] . '|' . $row['Comments'] . '|' . //Using the comments as the Gift Message as well. I can change this to be blank or maybe some generic "thank you for shopping at Origin Biomed'?? $row['Comments'] . '|' . $row['BillCompany'] . '|' . //Concetenate the First and Last Names $row['BillFirstName'] . ' ' . $row['BillLastName'] . '|' . $row['BillAddress'] . '|' . //Billing Address 2 ' ' . '|' . $row['BillCity'] . '|' . $row['BillState'] . '|' . $row['BillZIP'] . '|' . $row['BillCountry'] . '|' . //Payment Terms are not found in the source file. We will fill in a blank value for this piece. ' ' . '|' . $row['ShippingDate'] . '|' . //No Cancel Date available from Store File ' ' . '|' . $row['OrderNumber'] . '|' . "\r\n"; } $output_file = 'Capacity Order.txt'; Now I want to save this as a file and upload it to an FTP site. Any tips? Thanks, Adam Quote Link to comment https://forums.phpfreaks.com/topic/75412-not-oop-help-but-the-general-help-forum-doesnt-appear-to-be-here-any-more/ Share on other sites More sharing options...
wildteen88 Posted October 30, 2007 Share Posted October 30, 2007 You'll you want to use fopen and fwrite to create and write to the file. Then use one of the built in FTP functions to upload the file to the remote server. Quote Link to comment https://forums.phpfreaks.com/topic/75412-not-oop-help-but-the-general-help-forum-doesnt-appear-to-be-here-any-more/#findComment-381525 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.