• 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 Validation and Submission to database

Undefined Array Key error when uploading image on php

Whats the point of running Laravel with the command 'php artisan serve'?

Minimum order amount except for specific shipping method in WooCommerce

Upload a file Using PHP and JavaScript

How to get total pages of PDF with FPDF?

Detect a fetch request in PHP

Timber: Single post pagination does not work (wp_link_pages)

Adding one microsecond to Datetime object in PHP

How should I get started using PHPUnit as a testing framework for a bunch of functions and classes I have already made?

Why do I have invalid argument supply for foreach in Laravel for json response? [duplicate]

how to remove white space in select 2

How to average columns of data from multiple, flat arrays?

stay with the last 15 elements of an array [duplicate]

XML to CSV with PHP converter [problem with images grabing]

About Contact Privacy policy Terms and conditions