Re: mySQL Problem



Einstein30000 <dominic_ernst@xxxxxx> writes:

in one of my php-scripts is the following query (with an already open
db-connection):

$q = "INSERT INTO main (name, img, descr, from, size, format, cat,
host, link, date) VALUES ('$name', '$img', '$descr', '$user', '$size',
'$format', '$cat', '$host', '$link', '$date')" or die(mysql_error());

And when the query gets executed i get back the following error:

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 'from, size, format, cat, host, link, date) VALUES ('bla', '-',
'keine', 'Holgi',' at line 1


FROM is a reserved word, you have to be careful on the column
names -- that is most likely the problem.

--
John
___________________________________________________________________
John Murtari Software Workshop Inc.
jmurtari@following domain 315.635-1968(x-211) "TheBook.Com" (TM)
http://thebook.com/
.



Relevant Pages

  • Re: simple?!? guestbook problem
    ... $query = "insert into guestbook ... > You have an error in your SQL syntax. ... Check the manual that corresponds to ...
    (alt.php)
  • Re: mySQL Problem
    ... And when the query gets executed i get back the following error: ... You have an error in your SQL syntax; ... Actually, problem is proper quoting, not the format or anything else. ...
    (comp.lang.php)
  • mySQL Problem
    ... in one of my php-scripts is the following query (with an already open ... And when the query gets executed i get back the following error: ... You have an error in your SQL syntax; ...
    (comp.lang.php)
  • Re: having problems with mySQL commands
    ... > enter the survey answers. ... > Query 6 failed because: You have an error in your SQL syntax; ... > the manual that corresponds to your MySQL server version for the right ...
    (comp.lang.php)
  • having problems with mySQL commands
    ... enter the survey answers. ... Query 6 failed because: You have an error in your SQL syntax; ... the manual that corresponds to your MySQL server version for the right ...
    (comp.lang.php)