954,180 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

probelm with autogenerated mysql query

Hi,

got another problem.

I have an interface that uses javascript to generate the Mysql WHERE condition of a query it posts to the a PHP page that retrieves values from the database. it works fine as usual on my local pc. but i when i uploaded it to my webhost machine it gave the 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 '\\\'%government college%\\\') LIMIT 0, 1' at line 1
SELECT * FROM Applicants WHERE (secSchName like \\\'%government college%\\\') LIMIT 0, 1

on my local pc the code appears as :


SELECT * FROM Applicants WHERE (secSchName like \\\'%government college%\\\') LIMIT 0, 1

i can see the error is from the \\\ but how do i correct it since i didnt put there in the first place.

iketunde
Newbie Poster
13 posts since Oct 2005
Reputation Points: 10
Solved Threads: 0
 
SELECT * FROM Applicants WHERE secSchName like '%government college%' LIMIT 0, 1;


Hopefully, it works.

PoA
Posting Whiz in Training
237 posts since Jul 2004
Reputation Points: 26
Solved Threads: 9
 

Is it allow LIMIT 0 in SQL query? This means there will return no result...

zippee
Posting Whiz in Training
294 posts since Jan 2005
Reputation Points: 10
Solved Threads: 7
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You