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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.