0

Hi everybody, got a small ( possible large as it's driving me bonkers lol ) problem. I'm making a stock level checking script using php/mysql. I need to make it so that the script checks each item of stock in the database and if the level of an item is below 3 print out a message. I've been at this for a few hours now trying if and while statements but just cannot seem to get my head round it. Hoping one of you good people can point me in the right direction.

Cheers for taking the time to read my post

3
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by madgokuss4
0

go along those lines:

$q = mysql_query( 'select * from stock' );
while ($object = mysql_fetch_object($q)) {
  if (mycheck($object) < 3)
    echo "sell at once $object->ticker!";
}

Edited by smantscheff: n/a

0

Thanks for the reply, at least i know i'm not totally mad and going along the right path with this. Just wondering though, the line

if (mycheck($object) < 3)

What is mycheck part about????

0

mycheck is a method of your own to check the stock-level of your items. It is hard to make a general stock-level method so you have to provide one for your self.

0

Thats ok was just checking before i went and jumped in both feet first. Thanks again for the hand!!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.