Forum Moderators: coopster
$test = 'A';
$query = sprintf("select DISTINCT location, count(*) FROM transport WHERE location LIKE '%s' GROUP BY location", mysql_real_escape_string($test));
echo $query ;
$result = mysql_query($query,$db);
if I enter the query in full text it works fine, the query is correctly echoed in the variable $query.
If however I use the above code snippet I get nothing returned in $result although there is no error, and there is definately entries in the database beginning with
please tell me where I am going wrong
thanks in advance
// sorry about this I am having a brainless moment I forgot to put in the wild card in the variable $test should be $test = 'A%';
nn :)