lifeisboost Posted January 1, 2007 Share Posted January 1, 2007 Hello everyone. im trying to make a script to insert product descriptions in theo DB. the problem im having is with anything that has a ' in the desc. I.E. if the word "it's" is in the desc it fails the input into the DB. here is the error i get. Invalid query: 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 't fit in the package with your order. Check out some other images from the ph' at line 1 if someone can shed some light this would help ALOT Link to comment Share on other sites More sharing options...
Jan Zonjee Posted January 1, 2007 Share Posted January 1, 2007 im trying to make a script to insert product descriptions in theo DB. the problem im having is with anything that has a ' in the desc. I.E. if the word "it's" is in the desc it fails the input into the DB. Since the values that are in the sql query are often surrounded by quotes MySQL does not know your ' is not the end or beginning of one. The database entry therefore need to be done with a slash (\) in front of the '. osC has a built in function for that called tep_db_input. So look in categories.php how it handles incoming POST variables and uses the function tep_db_input (admin/includes/database.php) to prepare the input to include in queries. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.