nimzie Posted February 26, 2008 Share Posted February 26, 2008 Hi, as my subject says, this is likely something I should be aware of. A simple import script which is something like: for($i=1; $i<sizeof($fcontents); $i++) { $line = trim($fcontents[$i]); $arr = explode( $delim , $line); $arr = explode( "\t" , $line); $sql = "insert into origin ( StoreID, OrderID, OrderNumber, OrderDate, IpAddress, Currency, CustomerID, BillFirstName, BillLastName,BillEmail,BillPhone,BillFax,BillCompany,BillAddress,BillCity,BillState,BillCountry, BillZIP,ShipFirstName,ShipLastName,ShipEmail,ShipPhone,ShipFax,ShipCompany,ShipAddress,ShipCity, ShipState,ShipCountry,ShipZip,Status,Comments,ShippingMethod,ShippingCost,ShippingTaxes,HandlingCost, ShippingDate,DeliveryDate,ValidationCode,PaymentMethod,PaymentCost,Coupon,AddOns,AddonValues,PaymentTaxes, CardNumber,CardName,CardExpiry,TransactionDate,PreAuthNumber,AuthNumber,ReferenceNumber,Questions,ShortQuestions, ItemID,ItemName,ItemCode,ItemType,Options,OptionCode,Quantity,ItemPrice,Taxes,Width,Length,Height,LengthUnit, Weight,WeightUnit,Language ) values (' " . implode ( "','" , $arr) . "')"; One of the fields contained "Mary's store". It failed the SQL Statement. Can anyone share some tips on how to get around this? Thanks. Adam Link to comment https://forums.phpfreaks.com/topic/93175-quotes-in-txt-file-how-to-ignore/ Share on other sites More sharing options...
tinker Posted February 26, 2008 Share Posted February 26, 2008 This 'might' help! Link to comment https://forums.phpfreaks.com/topic/93175-quotes-in-txt-file-how-to-ignore/#findComment-477355 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.