rogueblade Posted February 21, 2010 Share Posted February 21, 2010 Hey guys I'm building a restaurant reservation system and I'm stuck. I have a data-grid in which I want to print all the restaurants tables that currently exist and display which ones already have a reservation. I don't know how or if it's possible in a MySQL query. In case the restaurant thing is confusing, I'll use a social networking site as an example: You can query to get all users You can query to get all users that are your friend I want both of those in one. I want to display all the users but indicate which ones are already my friends. Is this possible in one query? Quote Link to comment https://forums.phpfreaks.com/topic/192853-is-this-possible/ Share on other sites More sharing options...
mapleleaf Posted February 21, 2010 Share Posted February 21, 2010 yes it is possible. You will also need to factor in dates I imagine but in the table you will have table_ids and date You then "SELECT * FROM tables; Then in results view you simply put an if statement such as Run a foreach($row) and within that if (date == today) { //you will change the today to whatever date they are choosing of course echo 'Booked'; //you might just color the table using css }else{ echo 'Available'; } I hope this gives the idea. Quote Link to comment https://forums.phpfreaks.com/topic/192853-is-this-possible/#findComment-1015818 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.