-1
I’m creating a hotel website for a school project, and I’d like to know if for each checkbox
that I created in the code, I will have to create a column in the database of the phpmyadmin
? And how to store this choice of checkbox
there in the database?
Note: I am using the xampp
<div id="quartos">
<div id="junior"> <input type="checkbox" name="quarto[]" value="op1"/> Suíte Júnior<br /></div>
<div id="duplo"> <input type="checkbox" name="quarto[]" value="op2"/> Quarto Solteiro Duplo<br /></div>
<div id="casal1"> <input type="checkbox" name="quarto[]" value="op3"/> Quarto Casal<br /></div>
<div id="vista"> <input type="checkbox" name="quarto[]" value="op4"/> Apartamento Luxo vista para a cidade <br /></div>
<div id="luxo1"> <input type="checkbox" name="quarto[]" value="op5"/> Apartamento Luxo <br /></div>
<div id="master1"> <input type="checkbox" name="quarto[]" value="op6"/> Suíte Master <br /></div>
</div>
In this case, I would suggest using radio button, because the room can only be an option (or not?), and make a column TIPO_QUARTO for example.
– Rafael Weber
Create columns or insert data into table columns?
– Isac
@Rafaelweber switched to radio burron and created the room type column. What do now ?
– Bia
The options you put in
div id="quartos"
. The user can only select one option, correct?– DNick
Well, you can follow what you have on [link] (https://wiki.locaweb.com.br/pt-br/Formul%C3%A1rio_php_%2B_Mysql)
– Rafael Weber
@Djalmamanfrin yes
– Bia