Sunday, 11 August 2013

insert data if the date time is different

insert data if the date time is different

i have 2 tables..
reservations_client and tables_clients
the reservation_client has 3 fields

id, name_client, date, table
the table_clients has 2 fields

id, name_table
when a client wants to reservate.. they put his name, the date, and choose
a table, but there is a problem.. 2 clientes cant use the same table.
i need: when the date is different.. it should insert the data to the
tables in the db.. if the date is the same.. it should send a error
i tried using an unique key.. but it send me error even if the date is
different..
ill write some codes of my problem: http://pastebin.com/uvc5tDWF

No comments:

Post a Comment