Re: MySQL Query not working?

From: Date: Tue, 15 May 2001 16:20:15 +0000
Subject: Re: MySQL Query not working?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-52884@lists.php.net to get a copy of this message
You might also want to remove the comma after "url = '$url'" and try an echo mysql_error($link) to see what the problem is. Julian on 5/14/01 5:46 PM, Peter Houchin - SunRentals Australia at peterh@vfsa.com.au wrote: > change it to > > $sql = "UPDATE CLASS_ADS > SET client_id = '$client_id', date = '$date', category = > '$category', > title = '$title', description = '$description', contact_name = > '$contact_name, contact_number = '$contact_number', email = > '$email', url = '$url', WHERE client_id = '$client_id' "; > > also if a MySQL query doesn't work I always try it on the command line :) > > > Peter Houchin > peterh@sunrentals.com.au > ========================================================= > _____ __ /\ > /_/_/_\ / |_/ \ > /_/_/_ __ __ __ __ / \ > \_/_/_\ /_/ /_/ /_/ /_/ \ _ / > ___\_\_\/ /_/_/_/ /_//\/_/ \_/ \/\_/ > \_//_/_/ /_/_/_/ /_/ \/_/ v > ________ ________________________________________ > /_/_/_/_/ /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ > /_/_ _/_/ ______ __ __ /_/ ____ __ ______ > /_/_/_/_/ /_/_/_/ /_/ /_/ /_/ /_/\_\ /_/ /_/_/_/ > /_/ \_\ /_/ _/ /_//\/_/ /_/ /_/__\_\ /_/___ _\_\_\ > /_/ \_\/_/_/_/ /_/ \/_/ /_/ /_/ \_\/_/_/_//_/_/_/ > ========================================================= > Telephone : (03) 9329 1455 Facsimile : (03) 9329 6755 > ************* We rent the dot in .COM! ************** > > > -----Original Message----- > From: Laurie Landry [mailto:lmlweb@lmlweb.com] > Sent: Tuesday, May 15, 2001 9:23 AM > To: php-general@lists.php.net > Subject: [PHP] MySQL Query not working? > > > Hi, I've got this sql setup where > > $sql = "UPDATE CLASS_ADS > SET client_id = \"$client_id\", date = \"$date\", category = > \"$category\", > title = \"$title\", description = \"$description\", contact_name = > \"$contact_name\", contact_number = \"$contact_number\", email = > \"$email\", url = \"$url\", WHERE client_id = \"$client_id\" > "; > > and of course the following: > > $sql_result = mysql_query($sql) > or die("Couldn't execute query."); > > which when I test the page, it tells me it couldn't execute the query. > > I hope the information above is enough for someone to help me pinpoint where > I went wrong. > > (all the fields in the named table in the database is set accordingly with > one thing: the client id number is autogenerated by the database, so I'm not > sure if the client_id should be there.) > > Thanks in advance: > > Laurie M. Landry > <lmlweb> Design & Development > > www.lmlweb.com > lmlweb@lmlweb.com > > T: (604) 872-6915 > F: (425) 732-1547 >

« previous php.general (#52884) next »