• 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

SMTP ERROR: MAIL FROM command failed: 530 5.7.0 Must issue a STARTTLS command first when using PHPMailer

auth pages not getting css in laravel

IlluminateDatabaseQueryException could not find driver [duplicate]

Undefined variable in Laravel 8 project (php 7.4)

Make certain characters of a word from string bold

PHP error: "The zip extension and unzip command are both missing, skipping."

Twig - How to check if variable is a number / integer

echo language construct is discouraged. (PHP)

How to KeyBy where multiple items have the same key

PHP random string generator

Check if my GET request has Header: Token

Send Outlook 2010 email using PHP

Mysqli multi query error

Refresh specific HTML content that retrieves data from MySQL

add " ? " in url via htaccess RewriteRule

About Contact Privacy policy Terms and conditions