•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 429,789 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 3,836 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: 3854 | Replies: 1
![]() |
•
•
Join Date: Oct 2005
Posts: 13
Reputation:
Rep Power: 4
Solved Threads: 0
Hello,
I created this page. it contains textareas and checkboxes. when user enters information or check any of the checkboxes. this translates to a conditioned query.i achieve this using javascript. u can find the url @
www.laterallinks.com\search.htm
try entering gibberish and any of the fields and click on the fetch applicants button.
it should check the database for possible qualified entries.
I test this on my local pc at home. it works very fine. on my local machine it executes fine
for example on my local pc if i enter washington high in the secondary school textarea this is what i get
SELECT * FROM Applicants WHERE (secSchName like \'%washington high%\') LIMIT 0, 1
but when i upload it to my webhost machine. it introduces extra slashes as shown below.
how do i stop this from happening.
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 '\\\'%washington high%\\\') LIMIT 0, 1' at line 1
SELECT * FROM Applicants WHERE (secSchName like \\\'%washington high%\\\') LIMIT 0, 1
I created this page. it contains textareas and checkboxes. when user enters information or check any of the checkboxes. this translates to a conditioned query.i achieve this using javascript. u can find the url @
www.laterallinks.com\search.htm
try entering gibberish and any of the fields and click on the fetch applicants button.
it should check the database for possible qualified entries.
I test this on my local pc at home. it works very fine. on my local machine it executes fine
for example on my local pc if i enter washington high in the secondary school textarea this is what i get
SELECT * FROM Applicants WHERE (secSchName like \'%washington high%\') LIMIT 0, 1
but when i upload it to my webhost machine. it introduces extra slashes as shown below.
how do i stop this from happening.
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 '\\\'%washington high%\\\') LIMIT 0, 1' at line 1
SELECT * FROM Applicants WHERE (secSchName like \\\'%washington high%\\\') LIMIT 0, 1
•
•
Join Date: Jul 2004
Location: Arizona State University
Posts: 56
Reputation:
Rep Power: 5
Solved Threads: 1
I dont know why, but maybe I can help. I at least know why there are three slashes!
Im sure you know that a back slash makes the next character literal.
The best example is a string that looks like this
var = "here is a \"quote\""
you know that you need to have \" like this in a string because otherwise it will interfere with the outer quotes which define the string as a whole. Well for some reason the code is anticipating needing a literal quote and doing this
\\\'
So, The first \ makes the second \ literal. the third \ makes the ' literal. It wants the end result to be \'
Like I said I dont know enough about what your doing to help you solve but at least I can help with explaining that much...
good luck
Brad W.
AZPixels
Im sure you know that a back slash makes the next character literal.
The best example is a string that looks like this
var = "here is a \"quote\""
you know that you need to have \" like this in a string because otherwise it will interfere with the outer quotes which define the string as a whole. Well for some reason the code is anticipating needing a literal quote and doing this
\\\'
So, The first \ makes the second \ literal. the third \ makes the ' literal. It wants the end result to be \'
Like I said I dont know enough about what your doing to help you solve but at least I can help with explaining that much...
good luck
Brad W.
AZPixels
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- test mysql query for no results (PHP)
- Double MySQL Query (PHP)
- MySQL query's (MySQL)
- Change MySQL Query Timeout Period (MySQL)
- probelm with autogenerated mysql query (PHP)
- problem with autogenerated mysql query (MySQL)
Other Threads in the PHP Forum
- Previous Thread: php image resize quality
- Next Thread: Php With Pdf


Linear Mode