I have this database I created with a phpMyAdmin client. Specific queries like SELECT * FROM TagData LIMIT 0,10
in my php code runs perfect. But when I add a wildcard to the query like SELECT * FROM TagData WHERE Device_Name LIKE 'Valve%' LIMIT 0,10
it doesn't work. The strange thing is that the exact same SQL works perfect in the phpMyAdmin tool.
This is how I run my query in php:
$query="SELECT * FROM TagData WHERE Device_Name LIKE 'Valve%' LIMIT 0,10";
$tmpResult=mysql_query(sprintf($query));
I have a strong feeling that the quote characters in the $query string are the problem. Can someone please explain me what I am doing wrong and why I am doing this wrong.
The result mysql_error() gives is:
Query was empty