Welcome Guest, Not a member yet? Register   Sign In
insert array of sessions into the database
#1

[eluser]Corbee[/eluser]
Hi,

I'm having trouble in the controller trying to get the session into the database.

Code:
$_SESSION['basic_premium']
$_SESSION['gross_premium']
$_SESSION['net_premium']

I know that if it is inserting one field it is

Code:
foreach ($_SESSION['basic_premium'] as $rows)
data = $this->MData->insert($rows['basic_premium']);

but how do I group the whole thing to insert it into the database?

thanks
#2

[eluser]Corbee[/eluser]
I just thought that if I change it to

$_SESSION['data']['basic_premium']
$_SESSION['data']['gross_premium']
$_SESSION['data']['net_premium']

it would be easier to loop, but then after trying something like this

Code:
foreach ($_SESSION['data'] as $row)
{
    echo $list['price'];
}

but I got error
#3

[eluser]InsiteFX[/eluser]
I think you need to look at the session library
in the codeginter user's guide!

For one you are using the wrong sessions for database.

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB