Guest User

Untitled

a guest
Oct 14th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. $q=mysql_query("SELECT * FROM `warehouse` ORDER BY `id`");
  2. while($post=mysql_fetch_array($q)){
  3. if(isset($_POST['update_quantity'])){
  4. $quantity=mysql_real_escape_string($_POST['quantity']);
  5. mysql_query("UPDATE `warehouse` set `quantity`='$quantity' where `id` = '$post[id]'");
  6. echo "<script>location.href = 'http://restaurant.dachniki.top/warehouse.php' </script>";
  7. }
  8. ?>
  9. <center>
  10. <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
  11.  
  12. <? echo "<font color=green><b>$post[name]</b></font>";?>
  13.  
  14. </div>
  15. <form method=POST>
  16. <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
  17. <b>
  18.  
  19. <input type="number" name="quantity" value="<?echo $post['quantity'];?>">
  20.  
  21.  
  22. </b>
  23. </div>
  24. <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
  25. <b>
  26.  
  27. <input type="submit" name="update_quantity" value="Сохранить">
  28.  
  29.  
  30. </b>
  31. </div>
  32. </form>
  33. </center>
  34. <br>
  35. <hr>
  36. <?
  37. }
Advertisement
Add Comment
Please, Sign In to add comment