• 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

How to KeyBy where multiple items have the same key

NGINX: connect() to unix:/var/run/php7.2-fpm.sock failed (2: No such file or directory)

How do I get friend list from Friends table with counts of friends of my friends

Fatal error: [] operator not supported for strings

How can I solve "laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system"?

Group rows by column and sum another column within groups [duplicate]

OctoberCMS / Anonymous Global Scope

find in set in laravel ? example

The sum of the user's points

renameColumn migration fails for existing column with columns does not exist error

How to separate letters and digits from a string in php

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'name' cannot be null

Add record for each array elements if missing in table

Display a success custom notice after Placing an Order in WooCommerce

PHP rotate matrix counter-clockwise

About Contact Privacy policy Terms and conditions