943,514 Members | Top Members by Rank

Ad:
  • MySQL Discussion Thread
  • Unsolved
  • Views: 597
  • MySQL RSS
Jul 27th, 2009
0

Delete rows from database

Expand Post »
I'm trying to delete rows from my database by using an HTML form. I can retrieve the database and display it nicely in a table using this code:
MySQL Syntax (Toggle Plain Text)
  1. <table width="889" border="1">
  2. <tr>
  3. <td width="206" bgcolor="#999999"><div align="center"><strong>Site</strong></div></td>
  4. <td width="549" bgcolor="#999999"><div align="center"><strong>Reason</strong></div></td>
  5. <td width="112" bgcolor="#999999"><div align="center"><strong>Date Added</strong></div></td>
  6. </tr>
  7. <?php
  8. $row_count = 0;
  9. $columns = 3;
  10. while ($row = mysql_fetch_assoc($result)) {
  11. if ($row_count == $columns) {
  12. echo "</tr><tr>";
  13. $row_count = 0;
  14. }
  15. echo "<tr><td>";
  16. echo $row['Site'];
  17. echo "</td><td>";
  18. echo $row['Reason'];
  19. echo "</td><td>";
  20. echo $row['Date'];
  21. echo "</td>";
  22. $row_count++;
  23. }
  24. ?>
  25. </tr>
  26. </table>
Now I would like to add a checkbox beside each item that will delete it. Possibly be able to check multiple items and delete them by clicking a Delete button at the bottom of the table. Can anybody help me get started or point me to a good tutorial? Any help would be greatly appreciated.
Similar Threads
Reputation Points: 16
Solved Threads: 0
Junior Poster
sfrider0 is offline Offline
149 posts
since Oct 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MySQL Forum Timeline: Need help with SELECT query please!
Next Thread in MySQL Forum Timeline: How to handle poli-morphism using MySQL





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC