probelm with autogenerated mysql query

Reply

Join Date: Oct 2005
Posts: 13
Reputation: iketunde is an unknown quantity at this point 
Solved Threads: 0
iketunde iketunde is offline Offline
Newbie Poster

probelm with autogenerated mysql query

 
0
  #1
Oct 17th, 2005
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.
Last edited by iketunde; Oct 17th, 2005 at 10:06 am. Reason: typo error
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 234
Reputation: PoA is an unknown quantity at this point 
Solved Threads: 8
PoA PoA is offline Offline
Posting Whiz in Training

Re: probelm with autogenerated mysql query

 
0
  #2
Oct 17th, 2005
SELECT * FROM Applicants WHERE secSchName like '%government college%' LIMIT 0, 1;
Hopefully, it works.
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 294
Reputation: zippee is an unknown quantity at this point 
Solved Threads: 6
zippee's Avatar
zippee zippee is offline Offline
Posting Whiz in Training

Re: probelm with autogenerated mysql query

 
0
  #3
Oct 17th, 2005
Is it allow LIMIT 0 in SQL query? This means there will return no result...
Ecommerce-Web-Store.com Building Your e-Business.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC