Page 1 of 1

PHP alert help needed

Posted: Fri Dec 17, 2010 7:39 am
by batowiise
Hi All,

I need help on implementing an alert using PHP and MySQL. The following is the plan:

1. User makes a requisition and the manager approves of it.

2. I want the manager to be alerted/notified of an impending requisition in the form of an alert.

The following is what i have done but it's not working:

<?php
require_once("admin/db.php");
$result = @mysql_query("SELECT * FROM users");
$row = mysql_fetch_array($result);
if($row['financealert']=='Yes'){
?>
<script type="text/javascript">
windows.alert('ATTENTION');
</script>
<?php
}
?>

Your help is welcome.

Regards.

Re: PHP alert help needed

Posted: Fri Dec 17, 2010 10:19 am
by klevis miho
Maybe $row['financealert'] is always a 'No'

Re: PHP alert help needed

Posted: Fri Dec 17, 2010 10:42 am
by batowiise
Could it be a session issue because the user must login first into the system? When i query for financealert='Yes' in MySQL, it returns two records that is:

SELECT * FROM users WHERE financealert='Yes'

What could possibly be the issue?