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.
PHP alert help needed
Moderator: General Moderators
-
klevis miho
- Forum Contributor
- Posts: 413
- Joined: Wed Oct 29, 2008 2:59 pm
- Location: Albania
- Contact:
Re: PHP alert help needed
Maybe $row['financealert'] is always a 'No'
Re: PHP alert help needed
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?
SELECT * FROM users WHERE financealert='Yes'
What could possibly be the issue?