Hi all,
The code below is supposed to pop up an alert based on the condition specified. It works fine for about six (6) entries or transaction. On the seventh transaction, the alert stops responding.
<?php
session_start();
$username = $_SESSION['username'];
require_once("admin/db.php");
$result = mysql_query("SELECT * FROM users WHERE username='$username'") or die(mysql_error());
$rs = mysql_query("SELECT * FROM generalclaims") or die(mysql_error());
$rsdepartment = mysql_query("SELECT * FROM generalclaims WHERE department='FINANCE'") or die(mysql_error());
$rsgenapprovallevel = mysql_query("SELECT * FROM generalclaims") or die(mysql_error());
$pettycashapprover = mysql_result($result,0,'pettycashapprover');
$approvallevel = mysql_result($result,0,'approvallevel');
$userdepartment = mysql_result($result,0,'department');
$systemapprovallist = mysql_result($rs,0,'systemapprovallist');
$gendepartment = mysql_result($rsdepartment,0,'department');
if($_SESSION['username'] == $username && $pettycashapprover == 'YES' && $approvallevel == 'FIRST' && $userdepartment == 'FINANCE' && $systemapprovallist == 'FIRST'&& $gendepartment == 'FINANCE')
{
echo"<script>alert('Issues Pending for your approval.');</script>";
}
elseif($_SESSION['username'] == $username && $pettycashapprover == 'YES' && $approvallevel == 'SECOND' && $systemapprovallist == 'SECOND')
{
echo"<script>alert('Issues Pending for SECOND your approval.');</script>";
}
elseif($_SESSION['username'] == $username && $pettycashapprover == 'YES' && $approvallevel == 'THIRD' && $systemapprovallist == 'THIRD')
{
echo"<script>alert('Issues Pending for THIRD your approval.');</script>";
}
?>
I have cross checked the records in the database and everything is fine from the records in the database.
Can anyone help me out?
Regards.
Alert stops responding
Moderator: General Moderators
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: Alert stops responding
Is this a pattern? The problem could be with the conditions that has to be met each time.batowiise wrote:It works fine for about six (6) entries or transaction
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering