I have an hotel search form with these fields: arrival,departure,rooms,adults,children.(last 3 fields are select list)
I created a table in phpmyadmin with the same fields, so when I click on submit the table should get populated with this data
and I should be able to see it with phpmyadmin.The problem is that for the last 3 fields I get a message saying that I must specify
a default value or it will not work.Since I have to choose how many rooms, adults and children.what value should I indicate,if I put
1 it works but only if I insert 1 room,1adult,1child.If I put 2 same thing 2 of everything which is not right.It should accept the values I
select but it doesn't. Can you help me? Thank you.
You're missing some really important details from your question such as:
- your exact table definition (SHOW CREATE TABLE your_table)
- your PHP code that tries to write to the database
- the exact error message produced (if it suggests an error on line N, you'll also need to tell us which line in PHP this refers to).
With more information we can help. At this stage it would just be guesswork though.
Hi sorry for replying late I was away for a couple of days and thank you for your help. Luckily the problem solved itself, what I mean is that now works beautifully I can insert different values in the select options and no problem. The only thing I can think of is that I deleted all the temp files, ran disk cleanup and from Internet options I deleted all the cookies, history etc. could that have been the solution? Anyway now is solved. I'll need some more help though as the project I am working on is very difficult for my limited knowledge. For instance I can insert the dates of the reservation in the textbox and it works.But if I use a popup calendar it does not work because the time format is different from what phpmyadmin accepts, what can I do? Of course I can forget about the popup calendar if I cannot solve this. Thanks a lot and excuse me for taking your time.