Multidimensional Array To Mysql Codeigniter
- by rochellecanale
A little help how can I create an input query using this array? Or how
can I pass it in the table? my table layout sample is this:
sales_table
id | product_name | price | qty | subtotal
This is derived from the var_dump() function.
Here is my code in array
//array code from unserialized function
$products = unserialize($this->session->userdata('product_list'));
//This is the output.
Array
(
[2] => Array
(
[id] => 2
[product_name] => NOKIA 5110
[product_desc] => Cellphone
[product_price] => 500.00
[product_qty] => 1
[product_amount] => 500
[product_code] => NOKI2012-84353
)
[3] => Array
(
[id] => 3
[product_name] => HP IPAQ RW6828
[product_desc] => Cellphone
[product_price] => 1500.00
[product_qty] => 1
[product_amount] => 1500
[product_code] => HP I2012-08386
)
)