OneEyedWillie Posted June 7, 2011 Share Posted June 7, 2011 Hi, I'm trying to create a page where we can remove bans from the MySQL database. I've come up with this so far, but need some help. <form method="post" action="viewbans.php" name="managebans"> <table width="100%" border="1"> <tr> <td>Remove?</td> <td>IP</td> <td>Username</td> <td>Reason</td> </tr> <?php mysql_connect("localhost", "islewar", "islewar") or die(mysql_error()); mysql_select_db("islewar") or die(mysql_error()); $result = mysql_query("select * from bans") or die(mysql_error()); while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td><input type=checkbox name=ban />"; echo "</td>"; echo "<td>"; echo $row['ip']; echo "</td><td>"; echo $row['username']; echo "</td><td>"; echo $row['reason']; echo "</td>"; echo "</tr>"; } ?> </table> <input type="submit" name="delete" value="Remove Bans" /> </form> It reads the data from the database and shows it on the screen correctly. I just can't get the checkboxes to delete when they are selected, Thanks Quote Link to comment https://forums.phpfreaks.com/topic/238677-deleteing-mysql-rows-with-php/ Share on other sites More sharing options...
Maq Posted June 7, 2011 Share Posted June 7, 2011 Show us the code where you are actually trying to delete the entry. Quote Link to comment https://forums.phpfreaks.com/topic/238677-deleteing-mysql-rows-with-php/#findComment-1226517 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.