Re: MySQL Update help needed

From: Date: Mon, 21 Jan 2002 09:18:26 +0000
Subject: Re: MySQL Update help needed
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-16020@lists.php.net to get a copy of this message
Hi Chris, Can anyone see what is wrong with this query? I am trying to update some fields, if I do an echo everything looks good but it doesn't update the fields in the DB - am I missing something obvious here? $mysql_query ("UPDATE search6 SET email = '$email',description = '$comments',category = '$category',url = '$url',type = '$type',country = '$country',rating = '$rating',fname = '$fname',state = '$state',region = '$region',city = '$city' WHERE id = '$id'"); =the story of my life I clean myself up and "everything looks good", but still none of the popular crowd are interested... =it is good that you have taken the precaution of an 'echo', and I'll assume that the db/tbl are connected and opened properly. =how do you know that "it doesn't update the fields"? If you are using a PHP MySQL_ fn, then remember that you'll only get a response if the row was actually updated (ie (possibly, but only) the first time you throw that particular dataset at the db. What is the result from the function - a resultset/resource identifier or something else? =have you taken the debug-output from the echo and copy-pasted it into either the MySQL client or an admin pkg? These will give you different error responses and show the DBMS' response to the combination of SQL and data. =my concern would be with the commas that don't appear to be followed by spaces. I always add the db_connector argument, and (just in case you haven't 'edited' the line for the email) assign the resultset to something. =if the above does not help, please provide more information, and we'll get down and boogie - even without the 'popular people'... =dn

« previous php.db (#16020) next »