• 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

I cannot create a auto generated date time in mysql workbench

httpd.conf on Windows: can't locate API model structure `php8_module`

protect images from being copied

Passing a boolean value from checkbox in Laravel form

Upload a file Using PHP and JavaScript

Changing font color in javascript

Eloquent insert id with sequence next value

How to display MySQL table using php and edit it in a web browser

Google API Heatmap Layer exception, why?

Can we define variables in `.tpl` files?

Install mysql client in docker image

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

Sentry on Symfony: how to exclude `NotFoundHttpException`

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

How to convert time from one timezone to another in PHP

About Contact Privacy policy Terms and conditions