Multidimensional Array To Mysql Codeigniter
Posted
by
rochellecanale
on Stack Overflow
See other posts from Stack Overflow
or by rochellecanale
Published on 2012-09-25T09:31:18Z
Indexed on
2012/09/25
9:37 UTC
Read the original article
Hit count: 145
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
)
)
© Stack Overflow or respective owner