Delete rows from database
| From: | Balasubramanyam A | Date: | Sat, 05 Jan 2008 14:03:53 +0000 |
| Subject: | Delete rows from database | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-266775@lists.php.net to get a copy of this message | ||
Hi all,
I'm searching names from MySQL and printing it on a browser. Also, I've
provided checkbox for all the rows and a delete button for a page. I want to
delete the selected rows from MySQL when I click on the "Delete" button. How
do I do that?
Here is the code which I used to print the rows after fetching the same from
MySQL
while ($line = mysql_fetch_array($resultset, MYSQL_ASSOC)) {
echo "\t<tr>\n";
echo "<td><input type=checkbox name=index /></ td>";
foreach ($line as $col_value) {
echo "\t\t<td> $col_value</td>\n";
}
//echo "<td><input type=button name=vcancel value=Cancel
/></td>";
echo "\t</tr>\n";
}