System stock

hye guys

I had a problem about my system stock.
I use php 5 and mysql.
My database ,let say 2 tables,order and stock table.
The flow of the system is when the people want to order stock, he/she must fill the order form.
The problem is, I want to show message if order value more than stock value after form was submitted.

Make a simple SELECT query, to retrieve actual stock from the database.
and then do a simple comparison