MySQL help

Hi all

I am sort of new to MySQl

I have installed a script on my website and need help with the following if ok

my wife created a account and used a few capital letters and a space in her username and logged in all ok and the page is where to write status updates and where a share button is, I am getting the following error, it only happens when capital letters and spaces are used

How would I go about fixing it please

Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's' ORDER BY messages_id DESC' at line 1

Thank you in advance, I can paste any coding or give the website address if need be to look at

It sounds like a problem with the script you installed. If the script is throwing that sort of error it usually means there is a SQL injection vulnerability in it and you would be advised to not use it.

doesn't echo take a string argument? this seems to be passing an assignment, not a string

Yep that's true; but in PHP an assignment is an expression that evaluates to whatever value was assigned, and due to order of operations the assignment happens before the echo, so echo actually does end up getting a string argument in this case. Normally you wouldn't write code like that though because it's confusing to read...

i just wanna see the final query string, because, going back to post #1, the problem is the value passed as "session first name" -- i'm guessing it contains a single quote

That's my feeling as well... actually the fix probably just involves changing the PHP for the query to: