There is no reason why you can't use single quotes around the HTML. You don't appear to have any single quotes with the HTML so this should work fine. Everything, including the double quotes, should be then stored in your database.
Regards --------------------------------------------------------------- ********** _/ ********** David Logan ******* _/ ******* ITO Delivery Specialist - Database ***** _/ ***** Hewlett-Packard Australia Ltd **** _/_/_/ _/_/_/ **** E-Mail: [EMAIL PROTECTED] **** _/ _/ _/ _/ **** Desk: +618 8408 4273 **** _/ _/ _/_/_/ **** Mobile: 0417 268 665 ***** _/ ****** ****** _/ ******** Postal: 148 Frome Street, ******** _/ ********** Adelaide SA 5001 Australia i n v e n t --------------------------------------------------------------- -----Original Message----- From: John Hicks [mailto:[EMAIL PROTECTED] Sent: Friday, 19 May 2006 10:03 AM To: Steve Cc: [EMAIL PROTECTED]; mysql@lists.mysql.com Subject: Re: than you for your answer but... Steve wrote: > thank you for the clue of double quoting the html when inserting into the > database.... but I still get the error. the problem seems to be that I have > quotes INSIDE the html code as well (links and pix) so, i still get this > error. > > " > Database Selected: candlecatalog > Query: insert into Products > (ProdID,ProdName,ProdType,ProdDesc,Price,Pic,Buy) Values ("VOALM","Almond > Votive","Votive","Our Almond scented Candles are melon > colored","1.25","","""<a href="HYPERLINK > "http://www.ccnow.com/cgi-local/cart.cgi?meltingpot_VOALM_http://www.the melt > ingpotonline.net/candleshop.html"><img"http://www.ccnow.com/cgi-local/ca rt.c > gi?meltingpot_VOALM_http://www.themeltingpotonline.net/candleshop.html"> <img > src="HYPERLINK > "http://www.ccnow.com/images/buy_button_f.gif"http://www.ccnow.com/image s/bu > y_button_f.gif" border="0" /> </a>""") > Results > Error 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 > 'href="HYPERLINK > "http://www.ccnow.com/cgi-local/cart.cgi?meltingpot_VOALM_h"http://www.c cnow > .com/cgi-local/cart.cgi?meltingpot_VOALM_h > " Your problem is not with MySQL but with the programming language you're using. It probably has a facility to do this. PHP, as another poster has noted, has the function "mysql_real_escape_string()". But you are not using PHP. What language are you using? Do you have a manual for it? Does it have a section on interfacing with MySQL? On escaping quotes? > > the code i want to insert is: > > "<a href="HYPERLINK > "http://www.ccnow.com/cgi-local/cart.cgi?meltingpot_VOALM_http://www.the melt > ingpotonline.net/candleshop.html"><img"http://www.ccnow.com/cgi-local/ca rt.c > gi?meltingpot_VOALM_http://www.themeltingpotonline.net/candleshop.html"> <img > src="HYPERLINK > "http://www.ccnow.com/images/buy_button_f.gif"http://www.ccnow.com/image s/bu > y_button_f.gif" border="0" /> </a>" > Since you surround this with double quotes and then include more double quotes inside it, perhaps you are not a native speaker of a language that uses " for quotes. In the ASCII character set (and on most keyboards), the beginning quotation mark and ending quotation mark are identical. This makes for difficulties when trying to enclose quotation marks within the larger quote. You can use the single quote ' inside double quotes or you can escape the quotes (by preceding them with an escape character: the backslash character in the case of MySQL). Hope that helps. --J PS Try to keep your messages in the same thread by replying to another message in that thread and not changing the subject. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]