I have a function. in that function in have a select query. another query should return the number of results that will be in the first query. I have this code:
function name ($f){
global $db;
...
$results = "SELECT `a` FROM `b` WHERE $where";
$results_num = ($query = mysqli_query($db, $results)) ? mysqli_num_rows($results) : 0;
echo $results;
echo $results_num;
}
will echo:
SELECT `a` FROM `b` WHERE `keywords` LIKE '%abc%'0
what is just $results
but not $results_num
? I do not understand why echo $results_num
wont be shown and why there is a 0
at the end of $results
so if there is someone who could give me advise to solve this I really would appreciate. thanks a lot.