Advertisement
michaelyuen

Untitled

Sep 21st, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. <?php
  2.     $sql = "INSERT INTO order_table (o_date, client_id, o_total) VALUES ('$date', $client_id, $order_total);
  3.     if ($con->query($sql)) {
  4.         $order_id = $con->insert_id;
  5.        
  6.         foreach ($order_lines as $order_line) {
  7.             $sql = "INSERT INTO order_lines (pid, price, color, size, qty, subtotal, order_id) VALUES ($pid, $price,  $color, $size, $qty, $subtotal, $order_id);
  8.             if (!$con->query($sql)) {
  9.                 $error[] = $con->error;
  10.             }
  11.         }
  12.     }
  13. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement