Jump to content

Not OOP Help, but the General Help Forum doesn't appear to be here any more


nimzie

Recommended Posts

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.