var sidebar_align = 'right';
var content_container_margin = parseInt('350px');
var sidebar_width = parseInt('330px');
PHP/mySQL slashing causing problems searching...
I have entries in my mySQL database that are slashed, e.g: Nick\\'s Cars
But the problem is when I come to call it from the database without a slash like this: Nick\'s Cars
I addslashes before the query is carried out:
But it still doesn't return anything.... I've tried it with a field that doesn't have to be slashed... it works fine..
$query="SELECT * FROM tod_company_information WHERE company_name='$company_name' ORDER BY $sort ASC";
Thanks in advance
Ok, I just realised it was backslashed anyway without me needing to addslashes... But it still didn't give me a result!
paste what it says.
try pasting the output and manually running it on the database and see what it says (may be an error)
This is the query as it stands:
I tried doing the query in php my admin and it doesnt appear to be giving my any results... hmph
SELECT * FROM tod_company_information WHERE company_name="Nick\\\\'s Cars" ORDER BY company_name ASC
try making it so it's:
SELECT * FROM tod_company_information WHERE company_name='Nick\'s Cars' ORDER BY company_name ASC
I tried using double and single quotes - but neither work!
you need to escape the /'s...
there should be a function for this on the php website,
sorry for all the posts, had to post 5 posts before i could post a url to another site
the above should be really helpful,
I looked on the link and used this "urlencode" syntax.. it works good! Thanks acewebi!! You tha man
Whenever you are using slash operator you have to make it execute in your script by escaping that operator. So use backslash before the slash operator to make it print.