In my php script this query returns no result
SELECT * from `category` WHERE `desc`='".$desc."' AND Category IS NOT NULL AND Category <> ''"
PHP code:
$query_categorie=mysql_query(("SELECT * from category WHERE category = '".$desc."' AND category IS NOT NULL AND category <> ''" ),$dblink1) or die(mysql_error());
$categoria_trovata=mysql_num_rows($query_categorie);
But if I copy and paste the same query in phpmyadmin I get results as expected
What's wrong? I tried to escape $desc
with mysql_real_escape_string
but nothing changed
Edit: it only happens with this value into category
field of the category
table='PC/SERVERS - PRE MADE' which seems to be the only one with /,- and spaces
For all others records, including other records with the / characther, script runs fine