Tuesday, 27 August 2013

resource(5) of type (mysql result) Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 5 in

resource(5) of type (mysql result) Warning: mysql_result(): Unable to jump
to row 0 on MySQL result index 5 in

<?php
include('dbconn.php');
$dbconnect = new DB_Class('ctresults', 'root', '');
$sem=$_REQUEST['sem'];
$roll=$_REQUEST['txtroll'];
$roll=mysql_real_escape_string($roll);
if($sem>6)
{
$query="SELECT name FROM `studentrecord` WHERE rollno=$roll And
sem=$sem";
$RS=mysql_query($query);
//var_dump($RS);
if (!$RS) {
echo 'Could not run query: ' . mysql_error();
exit;
}
$row = mysql_fetch_array($RS);
$name = mysql_result($RS, 0);
if(!$name)
{
header('Location:pagetwo.html');
exit;
}
I am getting mysql errors,because the result set is returning null value
what should i do? I want that when result set returns null value the page
must be redirected to 'pagetwo.html' please help!

No comments:

Post a Comment