Hope my question is correct to the post.
<form action="process.php?id=<?php echo intval($order['id']);?>" method="post">
<ul>
<?php
$sd = 'SELECT * FROM download WHERE pid IN ('.$order['pid'].') ORDER BY pid ASC'; // pid IN (3,4,5)
$qd = $db->rq($sd);
$no = 1; while($download = $db->fetch($qd)) {
?>
<li>
<?php echo $no; ?> <?php echo $download['title']; ?>
<input type="hidden" name="mid[]" value="<?php echo $order['mid']; ?>" />
<input type="hidden" name="pid[]" value="<?php echo $download['pid']; ?>" />
</li>
<?php $no++; } ?>
</ul>
<input type="submit" name="submit" value="Submit" />
</form>
Output
- Sony Ericsson Drivers
- Sony Ericsson Apps
- Samsung Drivers
- Motorola Drivers
Question
- How to store (save) the data
Output
to table structure at below onprocess.php
Data will be save something like these.
id | mid | pid | title ----------------------------------------- 1 | 1 | 3 | Sony Erricson Drivers ----------------------------------------- 2 | 1 | 3 | Sony Erricson Apps ----------------------------------------- 3 | 1 | 4 | Samsung Drivers ----------------------------------------- 4 | 1 | 5 | Motorola Drivers -----------------------------------------
process.php
if (isset($_POST['submit']) && !empty($_POST['submit'])) {
// I'm blur how to get dynamic mid[] & pid[] here
}