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:[EMAIL PROTECTED]]
Sent: Monday, January 21, 2002 3:18 PM
To: [EMAIL PROTECTED]
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'");
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]