Fletcher
10-26-2002, 07:57 PM
I cannot figure out what is wrong with this code. Please help
$q = "UPDATE profiles SET label = '$label', email = '$email', show_email = '$se', bio = '$bio', show = '$show' WHERE id = '$id'";
mysql_query($q) or die("What's wrong with this thing!?");
Spookster
10-26-2002, 08:35 PM
Is there an error? What's not working?
Fletcher
10-27-2002, 12:43 AM
it works except for the show = '$show'
is that some kind of keyword or something?
mordred
10-27-2002, 01:28 AM
So you mean that the value in $show does not appear in the 'show' field for the updated row? If so, what value did $show have before you inserted it into your query string?
Usually it helps for debugging to assign the whole query string to a variable and print that to see what the query really looked like.
Fletcher
10-27-2002, 06:13 AM
I changed show to show_p in my table and it works. It seems show is some kind of keyword or something?
show is a syntax that mysql can use - used for outputting information on the table/database. Though, so saying that, I'm a tad surprised that a field cannot be named it. If that were the case you wouldn't be able to name a field 'delete' and I'm pretty sure that I have before.
SHOW syntax in the manual (http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#SHOW)
Galdo
10-27-2002, 09:03 PM
Have a look here, this is the list of reserved words used by MySQL. Show and Delete are in fact there:
http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#Reserved_words