Jump to content

Archived

This topic is now archived and is closed to further replies.

dhrups

sending a notification

Recommended Posts

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:
[b]
machine_stock_level.php[/b]


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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.