Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php while($row = $shops->fetch_assoc()) : ?>
- <form method="post" action="project.php?id=<?php echo $id; ?>">
- <input type="hidden" name="shop[]" value="<?php echo $row['id']; ?>">
- <input type="text" name="boxposition[]" class="form-control" value="<?php echo $row['box_position']; ?>" style="width: 50px;">
- <input type="submit" name="update" value="Update Order" class="btn btn-primary">
- </form>
- <?php endwhile; ?>
- $shopid = $_POST['shop'];
- $boxorder = $_POST['boxposition'];
- foreach ($shopid as $index => $value) {
- $query = "UPDATE shops SET box_position = '".$boxorder[$index]."' WHERE id = '".$shopid[$index]."'";
- $update_row = $db->update($query);
- echo $shopid[$index].'<br>';
- echo $boxorder[$index].'<br>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement