Delete rows from database

Reply

Join Date: Oct 2008
Posts: 89
Reputation: sfrider0 is an unknown quantity at this point 
Solved Threads: 0
sfrider0 sfrider0 is offline Offline
Junior Poster in Training

Delete rows from database

 
0
  #1
Jul 27th, 2009
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:
  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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC