Re: Checkboxes to gather rows to delete

From: Date: Tue, 25 Feb 2003 10:47:05 +0000
Subject: Re: Checkboxes to gather rows to delete
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-25900@lists.php.net to get a copy of this message
print "<input type=checkbox name=\"rowid[".$row['rowid']."]\" value=\"".$row['rowid']."\">"; You must put all of those checkbox values into an array and then use the foreach loop, to process the selected checkbox items)... print_r($rowid); would print out the contents of the generated array should be something like: Array( 4=>4, 6=>6, 1024=>1024 ); with this you could generate a where clause with: where rowid in (4,6,1024) and you're done! :-) kind regards Christoph > I have a mysql database with a table using one column as a primary key. > (rowID). On a php page I use a query to list all of the rows of the table > and have a checkbox beside each row that should be used to check if you > would like to delete this row. Can someone give me an example using post > to pull the boxes that need to be deleted. > Thanks! > Lewis > > > -- CC

« previous php.db (#25900) next »