Re: mysql query

From: Date: Fri, 03 Oct 2003 10:43:18 +0000
Subject: Re: mysql query
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-164879@lists.php.net to get a copy of this message
Thanx Tom, i should of realized that lol. Again Thanx :) "Tom Rogers" <trogers@kwikin.com> wrote in message news:4538115281.20031003204148@kwikin.com... > Hi, > > Friday, October 3, 2003, 8:17:23 PM, you wrote: > CM> ok im stumped lol i have used this code in the past to insert data into > CM> mysql (im relitively new though) > CM> ------code-------- > CM> mysql_query("INSERT INTO Images (Image, desc) VALUES ('$name', > CM> '$description')") or die (mysql_error()); > CM> --end code--------- > CM> but i get this error] > CM> ---------error------------- > CM> You have an error in your SQL syntax. Check the manual that corresponds to > CM> your MySQL server version for the right syntax to use near ''Image', 'desc') > CM> VALUES ('2419091.jpg', 'stone')' at line 1 > CM> ----------- end error-------------- > CM> I found if i just try and record the name value it works fine but if i try > CM> to add the description i get the error. > CM> Any clues? > CM> :) > > > it may be because desc is a reserved word, put it in backticks > desc > > -- > regards, > Tom

« previous php.general (#164879) next »