PHP Code:
<?php
$server="localhost";
$user="user";
$password="password";
$database="database";
$db = new mysqli($server,$user,$password,$database);
if ($db->connect_errno) {
printf("Connect failed: %s\n", $mysqli->connect_error);
exit();
}
$q = 'SELECT COUNT(*) FROM example';
$r=mysqli_query($db,$q) or die(mysqli_error($db)." Q=".$q);
$r = mysql_fetch_row($r);
echo $r[0];
?>
For the life of me, I cannot see why this returns 0, or print_r($db) -> empty SQL array
Code:
mysqli_result Object ( )