Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Quote mayhem

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-05-2003, 09:48 PM
 
Light Speed Light Speed is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 921
 

Default Quote mayhem

In the text of a product description if I have double quotes on something like this:

"Me"

It works fine but if there is an apostraphe(single quote) like this within the doubles:

"I'm Me"


I get errors.

INVALID SQL: 1064 : You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '

magic_quotes_gpc is enabled so what could cause this?
Reply With Quote
  #2  
Old 08-12-2003, 11:10 PM
 
Light Speed Light Speed is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 921
 

Default

Actually any single quote in description text ' gets an error.

Anybody have an idea of what is causing this please.
Reply With Quote
  #3  
Old 08-13-2003, 05:34 AM
  kpayne's Avatar 
kpayne kpayne is offline
 

X-Adept
  
Join Date: Dec 2002
Location: Firetanksoftware.com
Posts: 469
 

Default

Bad coding.

I don't know if magic_quotes_gpc covers single quotes as well as double. But, it cannot be set at run time (if that's how you're doing it), and it will be overriden by magic_quotes_sybase.

The easiest way is just to fix every instance you stumble across of bad SQL by manually adding "addslashes()" around variables before the query is run.
__________________
X-cart Featured Products Manager from http://www.firetanksoftware.com - Put your products where you want, how you want.
Reply With Quote
  #4  
Old 08-13-2003, 09:34 AM
 
Light Speed Light Speed is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 921
 

Default

Thanks kpayne

Now how am I supposed to go through every php page to "fix" X-Cart's code? uuuuggggghhhh

The strange thing is this doesn't happen on an install I have of 3.3.3 but it does on my install of 3.4.3 on the same server so they broke it somehow
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:48 PM.

   

 
X-Cart forums © 2001-2020