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 Thanks in advance Ian
Hi Thank you so much for the reply Rukbat This is the SQL query $query = "SELECT*UNIX_TIMESTAMP() - date_created AS TimeSpent FROM message WHERE poster='".$_SESSION['SESS_FIRST_NAME'] . "' ORDER BY messages_id DESC"; echo $query; exit(); $result = mysql_query($query); Is that what you need Ian
Is this copy/pasted or did you type it here? SELECT*UNIX_TIMESTAMP() Needs a couple of spaces and a comma: SELECT *, UNIX_TIMESTAMP()