how to delete record one by one?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
valen53
Forum Contributor
Posts: 137
Joined: Tue Aug 27, 2002 9:29 am

how to delete record one by one?

Post by valen53 »

hi, all.
i got a problem now.
when i select all the record and display in the table, each record beside have a cancel button for delete a record. but the problem is i can't give value to that cancel button, so when click the button, system dunno delete which record.

anyone can help me ?
is OK if use checkbox , but i want use button
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

try

Code: Select all

<html><body>
<pre><?php print_r($_POST); ?></pre>
<pre><?php print_r(array_flip($_POST)); ?></pre>
<form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>">
	<table>
		<tr>
			<td>record #1</td>
			<td><input type="submit" name="1" value="delete" /></td>
		</tr>
		<tr>
			<td>record #2</td>
			<td><input type="submit" name="2" value="delete" /></td>
		</tr>
		<tr>
			<td>record #3</td>
			<td><input type="submit" name="3" value="delete" /></td>
		</tr>
	</table>
</form>
</html>
Post Reply