Please anybody can tell me what wrong with this code it showing this error---------> Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/ocwnewco/public_html/user/rejectedcase.php on line 62 the line 62 is showing this------->$ocwConnections = mysql_num_rows($result);
rejectedcase.php
<?php
require_once(ROOT_PATH.'DBconnect.php');
?>
<?php
/**
*get count of Reject
*
**/
function totalReject($zone,$Reject) {
$result = mysql_query("SELECT * FROM ocwconnections WHERE ZoneID = '$zone' AND RejectID = '$Reject'");
$ocwConnections = mysql_num_rows($result);
return $ocwConnections;
}
$ocwConnections = mysql_fetch_array(mysql_query("SELECT * FROM ocwconnections"));
$resultZone = mysql_query("SELECT * FROM `connection_zone` WHERE `Zone` <> 'All' ");
$resultReject = mysql_query("SELECT * FROM `connection_Reject` WHERE `Reject` <> 'All'");
?>
<?php
?>
<table border="1">
<tr>
<th class="tbhed">Zone</th>
<?php
$Reject = array();
while($connectioReject = mysql_fetch_array($resultReject)) {
echo "<th class=tbhed>".$connectioReject['Reject']."</th>";
$Reject[] = $connectioReject['RejectID'];
}
?>
<th class="tbhed">Total</th>
<th class="tbhed">Percentage</th>
</tr>
<?php
$arr = array();
while($connectioZone = mysql_fetch_array($resultZone)) {
?>
<tr>
<th><?php echo $connectioZone['Zone']; ?></th>
<?php
foreach($Reject as $value){
$arr[$connectioZone['ZoneID']][$value] = totalReject($connectioZone['ZoneID'],$value);
echo "<td>".totalReject($connectioZone['ZoneID'],$value)."</td>";
}
?>
<td><?php
$total = 0;
foreach($arr[$connectioZone['ZoneID']] as $value ){
$total = $value + $total;
}
echo $total;
?>
</td>
<td><?php
foreach($arr[$connectioZone['ZoneID']] as $key => $val){
if($key == 2){
$complete = $val;
}
}
@$per = $complete * 100 / $total;
if(!$per){
echo $per = 0;
}
else {
echo $per;
}
?>
% </td>
</tr>
<?php
}
?>
</table>