Jump to content


Photo

sending a notification


  • Please log in to reply
1 reply to this topic

#1 dhrups

dhrups
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 05 May 2006 - 11:25 AM

can anyone help me out?
I am trying to output a text or pop up box or something of the sort, to notify a user of the system, when the stock level reaches a minimum level. currently i am doing this manually, but i would like to generate this message automatically.

the code used for the manual notification is:

machine_stock_level.php



<?php

$result = mysql_query("SELECT category, model_number, quantity FROM main_stock WHERE quantity <= 10 ORDER BY category");
$row = mysql_numrows($result);



$i=0;
while ($i < $row)

{
$Category = mysql_result($result,$i,"category");
$Model_number = mysql_result($result,$i,"model_number");
$Quantity = mysql_result($result,$i,"quantity");

?>

<tr>
<td width="276" align="center" style="border-left-style: solid; border-left-width: 1; border-bottom-style: solid; border-bottom-width: 1" height="19"><b><font face="Arial, Helvetica, sans-serif"><? echo $Category; ?></font></b>&nbsp;</td>
<td width="200" align="center" style="border-left-style: solid; border-left-width: 1; border-bottom-style: solid; border-bottom-width: 1" height="19"><b><font face="Arial, Helvetica, sans-serif"><? echo $Model_number; ?></font></b>&nbsp;</td>
<td width="201" align="center" style="border-right-style: solid; border-right-width: 1; border-bottom-style: solid; border-bottom-width: 1" height="19"><b><font face="Arial, Helvetica, sans-serif"><? echo $Quantity; ?></font></b>&nbsp;</td>

</tr>


<?
$i++;
}
?>

</tr>

</table>


#2 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 05 May 2006 - 02:11 PM

I'm not sure I understand how the code you posted relates to the problem.

Everytime you run that script, you should just add in another query to check the stock level and if the results of the query match your level... you echo a message.

Maybe you can explain the problem a little more?

Info: PHP Manual





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users