Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Feb 2001
Posts: 21
Newbie
Newbie
Offline
Joined: Feb 2001
Posts: 21
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

Sponsored Links
Joined: May 1999
Posts: 3,039
Guru
Guru
Offline
Joined: May 1999
Posts: 3,039
Interesting. Does everything else seem to work ok? It seems that Netscape isn't passing the Number correctly perhaps. I'll need to download Netscape when I get back home and do some testing to see if I can duplicate this and get a fix out.


UBB.threads Developer
Joined: Feb 2001
Posts: 21
Newbie
Newbie
Offline
Joined: Feb 2001
Posts: 21
Yes, everything else seems to be working okay.

More strange info, which makes me even more sure that it's a server problem and not a script problem (but I posted it here to see if anyone had any ideas):

1. The server seemed to go down for a while soon after I was having these problems, and at the same time I shut down the computer and rebooted. After the server came back (and I turned the computer back on), it worked fine in Netscape.

2. Someone else just reported the exact same problem in the exact same place. Only it's in a different instance of the message board system (one that has been running unchanged since February with no such problems). The one I was having problems with this morning is in a different directory, and is a newer version, but from the quick comparison I made of the viewmessage.php files, they are identical (with the exception of some different comments) between the two versions. I don't know if the new problem was with Netscape or IE.

I've now sent a message to my ISP describing the problem, and I'll let you know if they have any ideas.

Joined: Feb 2001
Posts: 21
Newbie
Newbie
Offline
Joined: Feb 2001
Posts: 21
Some follow-up on this. The other person who reported the same problem was using IE, so I guess it's not a Netscape-specific problem.

Joined: May 1999
Posts: 3,039
Guru
Guru
Offline
Joined: May 1999
Posts: 3,039
Hmm, it's possible you have some database corruption. When contacting your ISP you might want to have them check for any corrupted tables and repair if necessary.


UBB.threads Developer
Sponsored Links
Joined: Feb 2001
Posts: 21
Newbie
Newbie
Offline
Joined: Feb 2001
Posts: 21
I'll have them check that - thanks.

They also just asked if it is a requirement to have magic quotes on or off.

Joined: May 1999
Posts: 90
Member
Member
Offline
Joined: May 1999
Posts: 90
You don't have to worry about magic quotes as w3t checks that and performs stripslashes on all variables if it is set.

Joined: Feb 2001
Posts: 21
Newbie
Newbie
Offline
Joined: Feb 2001
Posts: 21
I don't know if "solved" is the correct work, but I found out how to change it in order to eliminate the problem.

I thought after a while that the term "message" might be a reserved word - or something along those lines. This might be why the syntax "&message=123", used to identify the number of the message you wish to view, ended up giving a value of "YES" in the variable $message all the time.

So I changed the name of the variable in the links on the index page for a person's private messages (this is in "viewmessages.php" for the newer version, and "main.inc.php" for the older version that I still work with). It now reads something like "&numofmsg=123". Then on the first line of the "viewmessage.php" script, I put in this line:

$message = $numofmsg;

(instead of changing the name of the $message variable throughout the script)

I'm not sure if my reasoning is correct about why it works, but hey - it works! Even one of my users who has been having lots of problems with this is now reporting error-free private messages.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Posts: 70
Joined: January 2007
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240430)