User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 392,068 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,282 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1498 | Replies: 2
Reply
Join Date: Oct 2005
Posts: 13
Reputation: iketunde is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
iketunde iketunde is offline Offline
Newbie Poster

probelm with autogenerated mysql query

  #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 9:06 am. Reason: typo error
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2004
Posts: 191
Reputation: PoA is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 2
PoA PoA is offline Offline
Junior Poster

Re: probelm with autogenerated mysql query

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

Re: probelm with autogenerated mysql query

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 11:51 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC