• 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

Form repeater send wrong data with last element in Laravel

Utf8 encoding issue with Laravel

Laravel 5.1 how to use {{ old('') }} helper on blade file for radio inputs

VichUploaderBundle error "Expected argument of type "File", "NULL" given" when submitting the form without selecting any file

PHP random string generator

PHP date() with timezone?

Star and Half Star Rating in Laravel

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 255

how to pass row id in href of a tag in codeigniter controller?

Using if(isset($_POST['submit'])) to not display echo when script is open is not working

Execute only one time and then wait set period of time before executing again

php retrieve specific data onclick from database in a list format

Loading data from MySQL and populating dropdown select with jQuery Mobile, PHP

Cross-Origin Resource Sharing (CORS) witth Laravel and Vuejs

How can i update or reset my password without entering email field in laravel-8?

About Contact Privacy policy Terms and conditions