Hi, I have this error Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\Program Files\xampp\htdocs\nsubackend\lib\model\classLabType.php on line 9 & same in line 52.
here's my code:
function __construct($id=0){
$con = new connection();
$query = "SELECT * FROM tbllabtype WHERE labtypeID='".$id."'";
$res = mysql_query($query);
if(mysql_num_rows($res)>0){
$row = mysql_fetch_array($res);
$this->setLabTypeID($row['labtypeID']);
$this->setLabTypeCode($row['labtypeCode']);
$this->setLabTypeDesc($row['labtypeDesc']);
}
}
function showAllLabType(){
$con = new connection();
$query = "SELECT labtypeID FROM tbllabtype";
$res = mysql_query($query);
if(mysql_num_rows($res)>0){
while($row = mysql_fetch_array($res)){
$theid[] = $row['labtypeID'];
}
return $theid;
}
}
please, can somebody help me? thank you