Unknown column 'yes' in 'where clause': 1054 - 09/27/2001 6:44 PM
You're gonna love this one. This is in the PHP version 5.4.3.
I'm viewing the list of private messages in my inbox (viewmessages.php). I click on one of the messages to read it, and get this error:
==========
SQL ERROR: Unable to do_query: SELECT M_Subject,M_Sender,M_Message,M_Sent,M_Status FROM w3t_Messages WHERE
M_Username = 'eccker_john' AND M_Number = yes
Unknown column 'yes' in 'where clause': 1054
=============
I tried a bunch of things - putting quotes around the $message variable in the query, grouping the parts of the query with ( ), etc., but I keep getting the same error (even if 'yes' is in quotes).
Then part of my thick skull parted and I realized that 'yes' isn't a valid value for $message - it should be the number of the message the person clicked on. When I look at the link on the previous page, it definately has "&message=11' in there correctly. But the value that keeps showing up in the next script is 'yes' instead of '11'. I rearranged the order of the arguments in that link to see if that helped (this helped in the past with another script), but no luck.
All this was using Netscape (4.7). I then viewed the page using IE5, and it worked perfectly - and all I did was copy the URL of the page that gave me the error from Netscape into IE, I didn't go through the whole message board system to arrive at that page. (even in Netscape, the URL in the address bar reads correctly, but there's some disconnect between what that says and what the server received)
I even added a line at the very top of viewmessage.php to echo "$message"; and it still displayed 'yes' and not '11' in Netscape - since it was the first thing in the script, there wasn't any chance that some other function was changing it.
So it looks like Netscape is not correctly passing the data to the server. Does this sound right? Or is there some magic PHP-level setting that can be changed to make this work correctly?
Thanks,
John
I'm viewing the list of private messages in my inbox (viewmessages.php). I click on one of the messages to read it, and get this error:
==========
SQL ERROR: Unable to do_query: SELECT M_Subject,M_Sender,M_Message,M_Sent,M_Status FROM w3t_Messages WHERE
M_Username = 'eccker_john' AND M_Number = yes
Unknown column 'yes' in 'where clause': 1054
=============
I tried a bunch of things - putting quotes around the $message variable in the query, grouping the parts of the query with ( ), etc., but I keep getting the same error (even if 'yes' is in quotes).
Then part of my thick skull parted and I realized that 'yes' isn't a valid value for $message - it should be the number of the message the person clicked on. When I look at the link on the previous page, it definately has "&message=11' in there correctly. But the value that keeps showing up in the next script is 'yes' instead of '11'. I rearranged the order of the arguments in that link to see if that helped (this helped in the past with another script), but no luck.
All this was using Netscape (4.7). I then viewed the page using IE5, and it worked perfectly - and all I did was copy the URL of the page that gave me the error from Netscape into IE, I didn't go through the whole message board system to arrive at that page. (even in Netscape, the URL in the address bar reads correctly, but there's some disconnect between what that says and what the server received)
I even added a line at the very top of viewmessage.php to echo "$message"; and it still displayed 'yes' and not '11' in Netscape - since it was the first thing in the script, there wasn't any chance that some other function was changing it.
So it looks like Netscape is not correctly passing the data to the server. Does this sound right? Or is there some magic PHP-level setting that can be changed to make this work correctly?
Thanks,
John