oha055 Posted October 5, 2011 Share Posted October 5, 2011 Hi, I have a problem regarding counting rows in a mysql table. Here is the code: <?php require_once('includes/connection.inc.php'); $conn = dbConnect('read'); $check = 'SELECT COUNT(*) FROM images'; $checkRes = $conn->query($check) or die(mysqli_error()); if($checkRes <= 0) { header('Location: empty_blog.php'); // redirect to another page } else { // do something else... } ?> The error I'm getting: "Notice: Object of class mysqli_result could not be converted to int in C:\xampp\htdocs\photoblog\index.php on line 6" Any help is greatly appreciated! Quote Link to comment Share on other sites More sharing options...
requinix Posted October 5, 2011 Share Posted October 5, 2011 You aren't using mysqli correctly. Read the manual, and pay special attention to the bits about mysqli_result. Quote Link to comment Share on other sites More sharing options...
oha055 Posted October 5, 2011 Author Share Posted October 5, 2011 Ok, thank you. I'll do that. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.