Advertisement
Guest User

Untitled

a guest
Aug 21st, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <?php while($row = $shops->fetch_assoc()) : ?>
  2. <form method="post" action="project.php?id=<?php echo $id; ?>">
  3. <input type="hidden" name="shop[]" value="<?php echo $row['id']; ?>">
  4. <input type="text" name="boxposition[]" class="form-control" value="<?php echo $row['box_position']; ?>" style="width: 50px;">
  5. <input type="submit" name="update" value="Update Order" class="btn btn-primary">
  6. </form>
  7. <?php endwhile; ?>
  8.  
  9. $shopid = $_POST['shop'];
  10. $boxorder = $_POST['boxposition'];
  11.  
  12. foreach ($shopid as $index => $value) {
  13. $query = "UPDATE shops SET box_position = '".$boxorder[$index]."' WHERE id = '".$shopid[$index]."'";
  14. $update_row = $db->update($query);
  15.  
  16. echo $shopid[$index].'<br>';
  17. echo $boxorder[$index].'<br>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement