Hi all,

I have this error message for about 7 days now (Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 8 in C:\xampp\htdocs\RAFIS\welcome.php on line 20), I have searched the on the net but not getting any clue yet.

My code is as follow:

PHP Code:
session_start();
$username $_SESSION['username'];

require_once(
"admin/db.php");
$result mysql_query("SELECT * FROM users WHERE username='$username'") or die(mysql_error());
$results mysql_query("SELECT * FROM users WHERE username='$username'") or die(mysql_error());
$resultes mysql_query("SELECT * FROM users WHERE username='$username'") or die(mysql_error());
$rs mysql_query("SELECT * FROM generalclaims WHERE systemapprovallist='FIRST'") or die(mysql_error());
$rs1 mysql_query("SELECT * FROM generalclaims WHERE systemapprovallist='SECOND'") or die(mysql_error());
$rs2 mysql_query("SELECT * FROM generalclaims WHERE systemapprovallist='THIRD'") or die(mysql_error());
$rsdepartment mysql_query("SELECT * FROM generalclaims") or die(mysql_error());

$pettycashapprover mysql_result($result,0,'pettycashapprover');
$approvallevel mysql_result($results,0,'approvallevel');
$userdepartment mysql_result($resultes,0,'department');
$systemapprovallist mysql_result($rs,0,'systemapprovallist');
$systemapprovallist1 mysql_result($rs1,0,'systemapprovallist');
$systemapprovallist2 mysql_result($rs2,0,'systemapprovallist');
$gendepartment mysql_result($rsdepartment,0,'department');

if(
$_SESSION['username'] == $username && $pettycashapprover == 'YES' && $approvallevel == 'FIRST' && $systemapprovallist == 'FIRST' && $userdepartment == 'FINANCE' &&    $gendepartment == 'FINANCE')
{
        echo
"<script>alert('Issues Pending for your approval.');</script>";
}

elseif(
$_SESSION['username'] == $username && $pettycashapprover == 'YES' && $approvallevel == 'SECOND' && $systemapprovallist1 == 'SECOND')
{
        echo
"<script>alert('Issues Pending for SECOND your approval.');</script>";
}

elseif(
$_SESSION['username'] == $username && $pettycashapprover == 'YES' && $approvallevel == 'THIRD' && $systemapprovallist2 == 'THIRD')
{
        echo
"<script>alert('Issues Pending for THIRD your approval.');</script>";

Is it a problem with mysql_result(). I was informed to use mysql_fetch_assoc() but I am confused about its usages especially to achieve my objective.

Your help needed please.

Regards,