1

i have this code :

<?php 
   $no=0;
   foreach($gejala as $g){ 
   $no++;?>
   <tr>

   <td><?php echo $no; ?></td>
   <td><?php echo $g->gejala; ?></td>
   <td><input type="checkbox" name="gejala<?php echo $no;?>" value="<?php echo $no;?>"?></td>

   </tr>

<?php } ?>

i need to get all selected checkbox value from my input into an array so i can use it to get value from my database, using this query

SELECT * FROM gejala WHERE id_gejala IN (array) AND id_penyakit = '1'
1

1 Answer 1

1

If you want to get all the values then you should give your checkboxes the same name, this way you'll get them in an array.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.