Hi Guys I am beginner in PHP i am getting Warning: mysql_fetch_array(): Eror... anybody help me
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home4/kksivash/public_html/drngpit/student-portal/admin/model.php on line 76
function get_deptbyID($id=""){
$sql = "SELECT * FROM department where id = ".$id;
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
while ($row = mysql_fetch_array($result, MYSQL_NUM))
return $row;
}
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home4/kksivash/public_html/drngpit/student-portal/admin/model.php on line 138
function get_semID($id="",$year=""){
$sql = "SELECT sid,sname,year,did FROM semester where did =".$id." ORDER BY sname ASC" ;
$result = mysql_query($sql);
while($row = mysql_fetch_array($result)){
$res[] = $row;
}
if(isset($res))
return $res;
else
return 0;
}
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home4/kksivash/public_html/drngpit/student-portal/admin/model.php on line 151
function get_internalID($id=""){
$sql = "SELECT no_internals FROM department where id =".$id."" ;
$result = mysql_query($sql);
while($row = mysql_fetch_array($result)){
$res[] = $row;
}
if(isset($res))
return $res;
else
return 0;
}