I've stumbled upon a simple MySQL error, and it seems my attempts of fixing it are effortless. The problem, it's not counting.
Before I go further, I know that mysql_*
is Deprecated, and that I shouldn't use it. I should use mysqli_*
or PDO.
This is my Query, and yes, the echo
is just for testing.
$ms_sql = mysql_query("SELECT * FROM mijnsp WHERE sp_username = '".$user['username']."'");
while ($mijnspusers = mysql_fetch_assoc($ms_sql)) {
$ms_count = mysql_num_rows($ms_sql);
if($ms_count <= 0){
echo "Result is empty";
}else{
echo $mijnspusers['new_username'];
}
I've tried to change the IF, but with no effect;
if($ms_count <= "0"){
or, like this
if($ms_count <= '0'){
Thank you in advance, Pascal