-1
How to automatically create check box with data coming from a database table?
-1
How to automatically create check box with data coming from a database table?
1
<?php
$result_categorias = "SELECT * FROM categoria";
$result_categorias = mysqli_query($conn, $result_categorias);
while($row_categorias = mysqli_fetch_assoc($result_categorias)){
?>
<input type="checkbox" name"categoria" value="<?php echo $row_categorias['id']; ?>"><?php echo $row_categorias['nome']; ?></option>
<?php } ?>
Browser other questions tagged php mysql
You are not signed in. Login or sign up in order to post.
Do a while/foreach and create checkboxes within it with their id, values and descriptions. You already have some code done, you can ask him the question?
– rray
I haven’t made the code yet but I will and as soon as I’m done.
– Lucas Lima
Need to provide more details, are you using PDO or Mysqli to connect to the bank? what information should the checkbox have? has the query made? add these details to the question.
– rray
I just made here reusing previous codes and it worked
– Lucas Lima