Reputation: 1611
I have a problem with this php code.
$q=$cn->exec('call get_count(1,@no_of_users)');
$res=$cn->query('select @no_of_users')->fetchAll();
echo "users".$res['@no_of_users'];
print_r($res);
I get this output.
usersArray ( [0] => Array ( [@no_of_users] => 3 [0] => 3 ) )
Can anyone tell me how to echo value 3 only. That means I need to show the value of '@no_of_users'.
Upvotes: 1
Views: 67
Reputation: 57
If $cn holds PDO instance use fetchColumn() instead of fetchAll()
Upvotes: 0