iShaddic
New Member
- Mar 19, 2012
- 6
- 0
Error given:
Code:
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/****/public_html/forum.php on line 7
PHP Code:
PHP:
$_ROWS = mysql_num_rows ($_CATEGORIES);
Full PHP Code:
PHP:
<?php
include("Header.php");
mysql_query("update Members set myLocation = '".$_SERVER['PHP_SELF']."' where ID = '".$userRow['ID']."'");
$_CATEGORIES = mysql_query("SELECT * FROM `Forums` ORDER BY `Id` ASC");
$_ROWS = mysql_num_rows ($_CATEGORIES);
?>
<div id='container'>
<center>
<br />
<div style='width: 90%; text-align: left; font-size: 10pt; border: 1px gray solid; background-color: #CCC; color: gray; padding: 6px;'>
<table id='forum' width='90%'>
<tr style='width: 100%; text-align: left; font-size: 10pt; border: 1px black solid; background-color: #DDD; color: gray; padding: 6px;'>
<td width='400' style='padding: 6px;'>
Category
</td>
<td width='100' style='padding: 6px;'>
Last Poster
</td>
<td width='100' style='padding: 6px;'>
Post Count
</td>
</tr>
<?php
for($x = 1; $x <= $_ROWS; $x++) {
$_ROW = mysql_fetch_array($_CATEGORIES);
$_POST_COUNT = mysql_num_rows(mysql_query("SELECT * FROM `ForumThreads` WHERE `category`='$_ROW[ID]'"));
if($_ROW['Name'] != "[sep]") {
?>
WHY IT NO WORK?
Code:
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/****/public_html/forum.php on line 7
PHP Code:
PHP:
$_ROWS = mysql_num_rows ($_CATEGORIES);
Full PHP Code:
PHP:
<?php
include("Header.php");
mysql_query("update Members set myLocation = '".$_SERVER['PHP_SELF']."' where ID = '".$userRow['ID']."'");
$_CATEGORIES = mysql_query("SELECT * FROM `Forums` ORDER BY `Id` ASC");
$_ROWS = mysql_num_rows ($_CATEGORIES);
?>
<div id='container'>
<center>
<br />
<div style='width: 90%; text-align: left; font-size: 10pt; border: 1px gray solid; background-color: #CCC; color: gray; padding: 6px;'>
<table id='forum' width='90%'>
<tr style='width: 100%; text-align: left; font-size: 10pt; border: 1px black solid; background-color: #DDD; color: gray; padding: 6px;'>
<td width='400' style='padding: 6px;'>
Category
</td>
<td width='100' style='padding: 6px;'>
Last Poster
</td>
<td width='100' style='padding: 6px;'>
Post Count
</td>
</tr>
<?php
for($x = 1; $x <= $_ROWS; $x++) {
$_ROW = mysql_fetch_array($_CATEGORIES);
$_POST_COUNT = mysql_num_rows(mysql_query("SELECT * FROM `ForumThreads` WHERE `category`='$_ROW[ID]'"));
if($_ROW['Name'] != "[sep]") {
?>
WHY IT NO WORK?
Page:
You must be registered for see links