delete records
Posted: Thu Apr 08, 2004 8:24 am
hi,
i'm kinda at this whole php thing and i got a little problem here; when visitors press some button, they get to see a table with some info retrieved from my mysql db
like this:
this is to show the table. now my problem is, that when they press the delete button next to te row they want to delete, i want the record to be deleted from the db.
how can i do this best?
don't know quite how to start, first off all, how do i know wich row they want to delete, second, how can i make it a pressing button, not a flat image, third, how do i know if they pressed the delete button, ...
can anyone help me?
thx
RuffRyder
i'm kinda at this whole php thing and i got a little problem here; when visitors press some button, they get to see a table with some info retrieved from my mysql db
like this:
Code: Select all
<?
while ($row = mysql_fetch_array($result)){
print "\t<tr>";
print "\t\t<td align='center'><font color='#666666' face='tahoma'><b>" . $row["model"] . "</b></font></td>";
print "\t\t<td align='center'><font color='#666666' face='tahoma'><b>" . $row["breedte"] . "</b></font></td>";
print "\t\t<td align='center'><font color='#666666' face='tahoma'><b>" . $row["lengte"] . "</b></font></td>";
print "\t\t<td align='center'><font color='#666666' face='tahoma'><b>" . $row["type"] . "</b></font></td>";
print "\t\t<td align='center'><font color='#666666' face='tahoma'><b>" . $row["stab"] . "</b></font></td>";
print "\t\t<td align='center'><font color='#666666' face='tahoma'><b>" . $row["cover"] . "</b></font></td>";
print "\t\t<td align='center'><font color='#666666' face='tahoma'><b>" . $row["aantal"] . "</b></font></td>";
print "\t\t<td align='center'><font color='#666666' face='tahoma'><b> <img src='images/delete.gif'> </b></font></td>";
print "\t</tr>";
}
?>how can i do this best?
don't know quite how to start, first off all, how do i know wich row they want to delete, second, how can i make it a pressing button, not a flat image, third, how do i know if they pressed the delete button, ...
can anyone help me?
thx
RuffRyder