RE: MySQL Update help needed

From: Date: Mon, 21 Jan 2002 23:02:29 +0000
Subject: RE: MySQL Update help needed
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-16039@lists.php.net to get a copy of this message
A few things to check: 1. You have a connection to the database (I'm assuming you do). 2. mysql_query() is a php function so you should not put a dollar sign before it (indicating it is a variable. If you want mysql_query() to return a variable, do something like this: $result = mysql_query("UPDATE.... etc"); 3. Check that you field names are the same, they are case sensitive (I'm pretty sure). 4. If all that doesn't work, try setting the query out in a logical pattern. This way it is easy to find mistakes. ie. $sql = “UPDATE search6 SET email = ‘$email’, description = ‘$comments’, ........ etc ........ region = ‘$region’ WHERE id = ‘$id’“); -----Original Message----- From: Chris Payne [mailto:chris@planetoxygene.com] Sent: Monday, January 21, 2002 3:18 PM To: php-db@lists.php.net Subject: MySQL Update help needed Hi there, 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? Thanks for your help Chris www.planetoxygene.com $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'");

« previous php.db (#16039) next »