LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-14-2005, 03:08 PM   #1
verbatim
Member
 
Registered: Apr 2005
Posts: 31

Rep: Reputation: 15
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

Last edited by verbatim; 06-14-2005 at 04:17 PM.
 
Old 06-14-2005, 03:36 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 124Reputation: 124
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.
 
Old 06-15-2005, 07:12 AM   #3
nephilim
Member
 
Registered: Aug 2003
Location: Belgium
Distribution: Debian (server), Kubuntu (desktop)
Posts: 248

Rep: Reputation: 30
The part

alt='We're here'

will definitely not work. You should try

alt='We\'re here'
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem inserting data into a mysql table using PHP Rockgod2099 Programming 13 08-03-2005 01:27 AM
I need help with inserting data into mysql w/ PHP lostboy Programming 3 08-25-2003 01:08 PM
inserting data in mysql zuessh Linux - Software 4 05-19-2003 02:00 PM
Problem Inserting MySQL data from PHP! rhuser Linux - Software 9 03-03-2003 08:56 PM
MySQL - Inserting Data Not Happening! Rhapsodic Programming 4 10-26-2002 11:58 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration