Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. <?php
  2. class Badcontroller extends CI_Controller {
  3.  
  4. public function do_save()
  5. {
  6. $orderdetails = [
  7. ['item_id' => 1, 'item_name' => 'Product ABC', 'qty' => 1, 'price' => 500, 'subtotal' => 500],
  8. ['item_id' => 2, 'item_name' => 'Product DEF', 'qty' => 2, 'price' => 100, 'subtotal' => 200]
  9. ];
  10.  
  11. foreach ($orderdetails as $orderdetail) {
  12. $this->db->insert('orderdetails', $orderdetail);
  13. }
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement