• 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

Performance of foreach, array_map with lambda and array_map with static function

how can I set a session variable in Drupal 8 and get it in a php script?

woocommerce get_order_report_data to show order_item_id

Laravel php artisan serve to mimic HTTPS

MySQL/PHP - Web Based Game -User specific inventory table or 1 giant table? Another option?

Combining a describing and one array with data

Reorder attribute dropdown terms in Woocommerce single variable products

MySQL/PHP - Web Based Game -User specific inventory table or 1 giant table? Another option?

How do I enable error reporting in Laravel?

Laravel You requested 1 items, but there are only 0 items available

Pages are working fine on localhost but not running on the hosting server

I cannot create a auto generated date time in mysql workbench

Symfony 4: how to allow dynamic values for array nodes in bundle configuration?

How to add class name to an existing tag in php

IlluminateDatabaseQueryException: SQLSTATE[HY000]: General error: 1 no such table - In clone project

About Contact Privacy policy Terms and conditions