Problem With Checkbox In Php - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › Problem With Checkbox In Php (1249 Views)
| Problem With Checkbox In Php by walterjnr(op): 4:19pm On Feb 01, 2020 |
please , how can i achieve this in shown in picture labelled "1" i used this code below and got what you are seeing in picture labelled "2" <table width="0" border="0"> <tr> <td width="200"><span class="style3 style3"> <label> <?php $sql ="SELECT * FROM tbl_permission"; $query = $dbh->prepare($sql); $query-> bindParam(':display_name', $display_name, PDO::PARAM_STR); $query->execute(); for($i=0; $row = $query->fetch(); $i++) { ?> <input name="checkItem[]" type="checkbox" value="<?php echo $row['id']; ?>"> <?php echo $row['display_name']; ?> </label> </span></td> </tr> <tr> <td> </td> </tr> <tr> <td><span class="style3"><span class="style3 style3"> <?php } ?> </span></span></td> </tr> <tr> <td><button type="submit" name="btn_save" class="btn btn-primary btn-flat m-b-30 m-t-30">Submit</button> </td> </tr> </table> i want my checkbox to display like in picture labelled "1"
|
| Re: Problem With Checkbox In Php by Thenaijaitguy: 4:57pm On Feb 01, 2020 |
You can use col-md-3 in bootstrap. It will divide the row into three . Let me know if that fix it . |
| Re: Problem With Checkbox In Php by resosdigital(m): 6:35pm On Feb 01, 2020 |
You shouldn't be using tables for layouts in the first place. You like use a grid system or css flexbox |
| Re: Problem With Checkbox In Php by walterjnr(op): 7:09pm On Feb 01, 2020 |
Thenaijaitguy:How do i use it in my code. Or is my code not correct? |
| Re: Problem With Checkbox In Php by Thenaijaitguy: 10:27pm On Feb 01, 2020 |
Your code is correct is just the hmtl and the styling.I can't really explain bootstrap here. Another trick is to use limit in your SQL query For the first column you can use limit 10 Same with the second column and set offset . If I'm less busy tomorrow I can write the code and upload on my site for you . |
| Re: Problem With Checkbox In Php by walterjnr(op): 11:21pm On Feb 01, 2020 |
Will be glad. Note i am calling the data from a single column. Thenaijaitguy: |
| Re: Problem With Checkbox In Php by Nobody: 9:25am On Feb 02, 2020 |
Go learn bootstrap. gerrout of here |
| Re: Problem With Checkbox In Php by ANTONINEUTRON(m): 2:06pm On Feb 02, 2020 |
Thenaijaitguy:might still be more complicated.. he should just solve d problem from d frontend. |
| Re: Problem With Checkbox In Php by walterjnr(op): 10:55pm On Feb 02, 2020 |
Thanks ANTONINEUTRON: |
| Re: Problem With Checkbox In Php by walterjnr(op): 7:59pm On Feb 03, 2020 |
Still waiting for the code o. Pls Thenaijaitguy: |
| Re: Problem With Checkbox In Php by Thenaijaitguy: 10:24pm On Feb 03, 2020 |
Using bootstrap will change your entire front end. Let's do this . I believe you have a column with the name $display_name and it contain all the data you want to display. Let's split them into four column in your database. With column name $name-group1 , $name_group2 ,$name-group3,$name-group4 |
| Re: Problem With Checkbox In Php by Thenaijaitguy: 10:32pm On Feb 03, 2020 |
In your front end you can do <tr> <TD> echo [name_group1] <TD> <TD> echo [name_group2] <TD> <TD> echo [name_group3] <TD> <TD> echo [name_group4] <TD> </tr> +234 815 667 8190 You can call me for more clarification |
| Re: Problem With Checkbox In Php by Thenaijaitguy: 12:47pm On Feb 09, 2020 |
Here is the solution.
|
| Re: Problem With Checkbox In Php by walterjnr(op): 2:43pm On Feb 09, 2020 |
Ok, I Have Mastered Crud In Php What Next ? • Who Can Solve This In PHP? • E-commerce Site In Php With Source Code • 2 • 3 • 4
Free Python Data Science Course For Beginners • I Will Build For You Free Android Game • Help In Deploying My Java .exe File With Jvm