Menna mekata uththarayak denna barida?
http://www.elakiri.com/forum/showpost.php?p=6708850&postcount=45
Oni nam kiyanna mama Sinhalen dannam me thread eke!
Ok no probs...
What it does is.. when you submit the form it goes to "check_row.php" and checks for existing record if none found then it submits, if there are records for the date and user_id combination it notifies you and send you back to index to change the date and try again!
Likewise you...
Dude.. I've created an example for you.. its very very basic one, you'll have to modify it further, just to give you an idea (proof of concept) only...
Download the ZIP file, setup it up in your localhost and check out the code.. its in PHP! :)...
It doesn't matter bro... for this first of all you need a good form validation if the user input the data... make sure the data string passed by the form is always standard creating a date drop down is your best option!
Ok lets look at the picture below think that this is your table.. with...
Ok I think I know your problem... you've set primary keys for "date" and "user_id" this doesn't work that way because "user A" and "user B" maybe getting only single row per day in the database.. right?
But the next day they are going to get another row... so having those fields as PK won't do...
Do you mean.. for example...
(User A) enters (record A) for 25.02.2010 - Allowed
(User B) enters (record A) for 25.02.2010 - Allowed
(User A) enters (record B) for 25.02.2010 - Not Allowed
???
Dont use date as a primary key, in your scenario its going to be repeated anyway!
You misunderstood me.. I was saying that Sri Lanka should build its own brand of tourism using the heritage we have, places like this... ofcourse I'm excited and proud to hear the news!