Sigmahokies Posted August 9, 2016 Share Posted August 9, 2016 (edited) Hi everyone I am trying to create the one table columns (I will do multiply columns later) with checkbox, it is good for people who show up for meeting or activity. I am trying to make a check that post in next below from checking chart, but it won't post at all, what did i do wrong? Can you help me? Thanks, Gary </table></fieldset></form><h2>Checbox works with database</h2><form action="portfolio.php" method="POST"><table><?php $list = "SELECT ID, FirstName, LastName FROM sample";$list2 = mysqli_query($connect, $list); if (mysqli_num_rows($list2)) {while ($row5 = mysqli_fetch_assoc($list2)) {echo "<tr><td>".$row5['FirstName']."</td><td>".$row5['LastName']."</td><td><input type='checkbox' value='".$row5['ID']."' name='check'></td></tr>";}}?><tr><td colspan="3"><input type="submit" name="check3" value="who showed up"></td></tr></table><table><?php if ($_POST['check3']) {$check = $_POST['check']; if ($check) {$select = "SELECT FirstName, LastName FROM sample WHERE = ID '%".$check."%'";$run = mysqli_query($connect, $select); if (mysqli_num_rows($run)) {while ($ran = mysqli_fetch_assoc($run)) {echo "<table>";echo "<tr><td>".$ran."</td></tr>";echo "<table>";}}}}?></table></form> Edited August 9, 2016 by Sigmahokies Link to comment Share on other sites More sharing options...
justsomeguy Posted August 9, 2016 Share Posted August 9, 2016 Your SQL query has an error, make sure that error messages are enabled and that you're checking for MySQL errors. Link to comment Share on other sites More sharing options...
Sigmahokies Posted August 10, 2016 Author Share Posted August 10, 2016 which query that I made error? Link to comment Share on other sites More sharing options...
dsonesuk Posted August 10, 2016 Share Posted August 10, 2016 Where = ID? WHERE what? equals ID. Link to comment Share on other sites More sharing options...
dsonesuk Posted August 10, 2016 Share Posted August 10, 2016 WHERE = ID? where what? equals ID. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now