Using Forge to Insert into database but not getting an insert ID

154 views Asked by At

I'm new to Fuel... got my script inserting a record using the following code:

             $address =  Model_Address::forge(array( 
                    'street1' => $step1_data['street1'],
                    'street2' => $step1_data['street2'],
                    'suburb' => $step1_data['street2'],
                    'city' => $step1_data['city'],
                    'region' => $step1_data['region'],
                    'country' => $step1_data['country'],
                    'postcode' => $step1_data['postcode'],
            ));

            $address->save();

I think I should be able to get the insert id via $address->id but it's empty.

I'm not sure what I'm doing wrong?

We are using pg_swl not sure if that makes any difference.

0

There are 0 answers