Author Topic: MySQL query fails  (Read 119 times)

0 Members and 1 Guest are viewing this topic.

Offline ericwright17Topic starter

  • Irregular
    • View Profile
MySQL query fails
« on: February 08, 2010, 10:38:35 PM »
when i run the following:

mysql_query("INSERT INTO hours (name, project, dates, isp, nhs, other, desc) VALUES ('a', 'a', 'a', 'a', 'a', 'a', 'a') ") or die(mysql_error());

why do i get this 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 'desc) VALUES ('a', 'a', 'a', 'a', 'a', 'a', 'a')' at line 1

Online thorpe

  • Staff Alumni
  • 'Mind Boggling!'
  • *
    • View Profile
Re: MySQL query fails
« Reply #1 on: February 09, 2010, 01:43:55 AM »
desc is a reserved word.
Patience is like bread I say, I ran out of that yesterday.

Debian :: Funtoo :: Hudzilla :: Rute :: How To Ask?

Offline hamza

  • Enthusiast
    • View Profile
Re: MySQL query fails
« Reply #2 on: February 09, 2010, 02:53:27 PM »
yeah desc is a reserv word try to change it ...descr or description.

PHP Freaks Forums

« on: »

Tired of these ads? Purchase a supporter subscription to get rid of them.