Re: Pulling a data from array of checkboxes
| From: | Cornelia Boenigk | Date: | Sun, 28 Jul 2002 01:30:00 +0000 |
| Subject: | Re: Pulling a data from array of checkboxes | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-20841@lists.php.net to get a copy of this message | ||
Hi
> In a new page how can I pull the data from a MySQL database
according to
> each value I passed from a previous page?
Not tested, just an idea;-)
For example
$chk[0] contains 12345, the value of checkbox1
$chk[1] contains 67890, the value of checkbox2 and so on.
<?php
foreach($chk as $key => $val) {
$sql = "SELECT field1, field2 ... from yourtable WHERE ID = $val";
$res = mysql_query($sql);
if ($res) {
$row = mysql_fetch_row($res);
// do something with the data in the retrieved row
}
}
Greetings
Conni