PHP POST method is successful but it shows mysql error and w

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
szamna
Forum Newbie
Posts: 1
Joined: Mon Mar 03, 2014 5:12 am

PHP POST method is successful but it shows mysql error and w

Post by szamna »

I turned the error reporting on using error_reporting(E_ALL) for one of the page on my website to identify the errors, that didn't work for that page but now its showing a weird error on another page that has forms and they are using the POST method, the query was running successfully before and even now and it saves the data but now it shows the following msg for every form post on that page :

Quote:
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 ') AND ((1 = 1)) AND ((1 = 1)) AND users.travel = 2 ORDER BY users.dateEdited DES' at line 35


I have tried everything to turn it off using error_reporting(0); in that file and even tried to turn the display off in php.ini but it just does not disappear...

Please kindly if anyone can help me out with it.

this is the code that probably this error is referring to..

Code: Select all

$query = '

SELECT DISTINCT users.ID, users.name, users.personalStatement, users.profilePicture, users.postCode, users.countryID, users.countryCustom, users.firstname, users.surname

FROM users

'.$joinSQL.'

WHERE type = "GRADUATE"

'.$addSQL.' ORDER BY users.dateEdited DESC, users.dateAdded DESC

'; 

the complete code is too long and it doesn't allow me to post it here, please if any one can help me i'll send the files in a PM may be
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: PHP POST method is successful but it shows mysql error a

Post by Celauran »

szamna wrote:the complete code is too long and it doesn't allow me to post it here
Pastebin?

What is the value of $addSQL? That looks to be where the problem lies. What is the current value and how is that variable being defined?
Post Reply