Jump to content


matching user input with db

  • This topic is locked This topic is locked
1 reply to this topic

#1 digitalgod

  • Members
  • PipPipPip
  • Advanced Member
  • 374 posts

Posted 15 October 2006 - 07:26 AM

hey guys,

well I posted in the PHP Help section and I was told to try my luck here as well.

I made a script for table reservations where a user enters how many they are and the script has to assign him a table. So for instance a user enters 5 and if in the database I have a table that seats 4 persons and another table that seats 8, the script has to assign him the table for 4 people, because it's a closer number. Now if I have a table for 4 and a table for 6, it has to assign him a table for 6 and so on. When the script assigns a table it also has to let the user what's the minimum amount of money the user has to spend to be able to reserve the table.

Here's a db example:

id  club_id  night_id  tbl_guests  tbl_x  min_price  full 
1        16          17              4      2        120  false
2        16          17              8      2        240  false

so tbl_guests is the table type (table that seats 4 people, 8 people, etc), tbl_x is the number of tables and min_price is the minimum amount they have to spend.

Is there a way to do this directly with a query?

#2 Barand

  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 15 October 2006 - 09:27 AM

Answered in PHP Help forum. Closed
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received


|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users