• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given [duplicate]

phpmysql


PHP Snippet 1:

$amn = mysql_query("SELECT * FROM `Messages` WHERE to_user='$usr' AND read='0'");

if($amn === false) {
    var_dump(mysql_error());
}
else {
    print_r(mysql_num_rows($amn));
}

Related Snippets

Laravel 8: Array to string conversion while calling route:list

How to solve Duplicate entry '0' for key 'PRIMARY' in Wordpress?

Access denied for user 'homestead'@'localhost' (using password: YES)

Cut an arabic string

What is wrong with this inner join sql query

insert multiple rows in a saveall in cakephp

How to remove from a multidimensional array all duplicate elements including the original?

Add record for each array elements if missing in table

I cannot create a auto generated date time in mysql workbench

Required field only if another field has a value, must be empty otherwise

How to check user Permissions using Custom Middleware in Laravel

PHPExcel file download using AJAX call

PHP my timezone is no setting up in PHP.ini File in xampp

"Unable to load dynamic library 'pdo_sqlsrv.so' "Cenos7 PHP7.2.10

PHP drop down list using array's and foreach (else and for) code

About Contact Privacy policy Terms and conditions