PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
hi,
Plz, show me how to do if I want to insert id_reservation into database when user clik to radiobutton.In my dtabase id_resrevation is primary key and auto_increment
These are all very basic debugging steps that everyone, not just yourself, should know and use to help us help you.
thank, this function runs well.
In database there are table Reservation,which contains id_reservation,id_student.But when I inserted id_reservation by cliking radiobutton,I have error : "Field 'id_student' doesn't have a default value" ???
That means you need to pass additional information so that id_student has a value associated. Since there is no default value you must set that field with every insertion.
hrubos wrote:hej, but I can do this with table,which has 1 rows, more attributes have error : Field '...' doesn't have a default value
means that I have to insert all attributes in tables. So how to do if I want to insert only attribut in table???
I'm not sure but I think the reason it's tellign you this is maybe the field that doesn't have a default value is a required field, and therefore if you don't tell it what value you want to add to the database, it will look to find a default value, then not find one and fail to insert the row.
That might just be your problem. I know that generally you do not have to enter all data in fields only the ones you want.