Jump to content

sending a notification


dhrups

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.