0

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\E-COMMERCE\admin\inventory_list.php on line 66
line 66:
$productCount= mysql_num_rows($sql); //count the output amount

<?php
//block grab the whole list for viewing
$product_list = "";
$sql = mysql_query("SELECT * FROM products ORDER BY date_added DESC");
$productCount= mysql_num_rows($sql); //count the output amount
if($productCount > 0)
{
2
Contributors
1
Reply
2
Views
4 Years
Discussion Span
Last Post by LastMitch
2

@hwoarang69

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\E-COMMERCE\admin\inventory_list.php on line 66

Line 66 is this:

$productCount= mysql_num_rows($sql);

Your mysql_num_rows() can't fetch the $sql because

on Line 65 is this:

$sql = mysql_query("SELECT * FROM products ORDER BY date_added DESC");

Your mysql_query() is not getting the data from your table because

It means that you can't connect to the database correctly because there's something wrong with your query!

You need to fixed your query in order for it to work.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.