LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   why do i get this error when inserting data to a mysql table (https://www.linuxquestions.org/questions/programming-9/why-do-i-get-this-error-when-inserting-data-to-a-mysql-table-333546/)

verbatim 06-14-2005 02:08 PM

why do i get this error when inserting data to a mysql table
 
when trying to insert to a table info for a picture with a html link to another site on it i get an error message:

counter INSERT error: 1064, You have an error in your SQL syntax near 'href='http://www.mysite.com' target='_blank'><img src='/uploa' at line 1


the mysql code is below

Code:

$damn = "<a href='http://www.mysite.com' target='_blnk'><img src='/uploads/mho.jpg' alt='We're here' /></a>";
 $c_insert = "INSERT INTO `timmy_config` VALUES ('pic4', $damn, 0)" or die('counter INSERT error: '.mysql_errno().', '.mysql_error());;

can someone tell me how i can get the image source and link sent to my table please?

Thanks in advance

Matir 06-14-2005 02:36 PM

Well, you've only quoted certain sections of this. You'll want to quote the whole thing. Perhaps '$damn' is what you are looking for.

nephilim 06-15-2005 06:12 AM

The part

alt='We're here'

will definitely not work. You should try

alt='We\'re here'


All times are GMT -5. The time now is 08:05 AM.