PHP alert help needed

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
batowiise
Forum Commoner
Posts: 28
Joined: Fri Dec 17, 2010 7:11 am

PHP alert help needed

Post 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.
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: PHP alert help needed

Post by klevis miho »

Maybe $row['financealert'] is always a 'No'
batowiise
Forum Commoner
Posts: 28
Joined: Fri Dec 17, 2010 7:11 am

Re: PHP alert help needed

Post 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?
Post Reply