Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Solution to product descriptions field quotes


toasty

Recommended Posts

How to import product description html with Easy Populate.

 

I have no idea if the last 100 posts have somewhere coverred this, but I could not find a fix.. The below method works for me so far (not fully tested yet), maybe it will help someone else. I am not yet sure how this stands up to standards testing.

 

1. Use single quotes in all html descriptions (instead of double quotes).

2. Use the php addslashes function on the description var just before the query string is created (on all update and insert queries for TABLE_PRODUCTS_DESCRIPTION

3. Ensure that all query strings are enclosed in single quotes (not the usual double) - that's a fair amount of patience required to change three or four update and inserts (and then get all the one's you missed) - and ensure all description strings are quoted with double quotes.

 

e.g. (not from the EP code)

.....
Where the old code looked as follows:
query$=
"UPDATE " . TABLE_PRODUCTS_DESCRIPTION . "
SET products_description = ' " .  $theEPdescription_var . " ',
........

Replace with:
.....
$mydescription_var = addslashes ( $theEPdescription_var);
query$= 
'UPDATE ' . TABLE_PRODUCTS_DESCRIPTION . ' 
SET products_description = " ' .  $mydescription_var . ' ",
........

 

 

Sorry its not more specific but have a deadline fast approaching.

Hope that helps someone.

 

C.

Link to comment
Share on other sites

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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