Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $sql = "INSERT INTO orders (orderID) VALUES ('.$rnd_id.'); ";
- $sql.= "INSERT INTO order_details (
- orderID,
- orderType,
- orderDate,
- orderTime,
- quantity,
- orderPrice,
- discount,
- discountPrice,
- employeeID
- )
- SELECT
- '.$rnd_id.' ,
- '.$type.' ,
- '.$date.' ,
- '.$time.' ,
- '.$quantity.' ,
- (unitPrice * '.$quantity.'),
- '.$dis.' ,
- (unitPrice * '.$quantity.') - ((unitPrice * '.$quantity.') * '.$dis.') ,
- '.$eid.'
- FROM product WHERE productID = '.$pid.'
- ; ";
- if (!$link->multi_query($sql)) {
- echo "Multi query failed: (" . $link->errno . ") " . $link->error;
- }
- do {
- if ($res = $link->store_result()) {
- var_dump($res->fetch_all(MYSQLI_ASSOC));
- $res->free();
- }
- } while ($link->more_results() && $link->next_result());
- product
- productID
- productName
- categoryID
- unitPrice
- unitsInStock
- discontinued
- order_details
- orderID
- orderType
- orderDate
- orderTime
- productID
- quantity
- orderPrice
- discount
- discountPrice
- employeeID
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement