hi to all,

can anyone help me how to use select_last_id on laravel.


Are you using Eloquent? If yes, right after you save something call the id property, for example:

$post        = new Post;
$post->title = 'Title';
$post->body  = 'Bla bla bla...';

$post->id; // <- last inserted id

Otherwise use the insertGetId() method:

$id = DB::table('users')->insertGetId(
    array('email' => 'john@example.com', 'votes' => 0)

As suggested here: http://laravel.com/docs/queries#inserts

here is my schema do i need to array all of this ?
i want also to adapt personal id to other table so i can join tables.

CREATE TABLE personnel (
personnel_id int(11) NOT NULL AUTO_INCREMENT,
hdo_id int(11) DEFAULT NULL,
first_name varchar(255) NOT NULL,
middle_name varchar(255) NOT NULL,
last_name varchar(255) DEFAULT NULL,
birth_date date NOT NULL,
mobile_number int(11) NOT NULL,
landline_number int(11) NOT NULL,
gender varchar(45) NOT NULL,
provincial_address_1 varchar(255) NOT NULL,
provincial_address_2 varchar(255) NOT NULL,
provincial_address_3 varchar(255) NOT NULL,
current_address_1 varchar(255) NOT NULL,
current_address_2 varchar(255) NOT NULL,
current_address_3 varchar(255) DEFAULT NULL,
PRIMARY KEY (personnel_id)

If you use the method insertGetId(), Laravel will return correctly, basing on the value of the auto_increment column. Docs:

By using Eloquent, instead, change the column name, for example:

$p               = new Personnel;
$p->first_name   = '...';
$p->middle_name  = '...';
$p->last_name    = '...';
$p->personnel_id; // <- last inserted id

It should work fine.

here is my schema do i need to array all of this ?

Sorry, I do not understand. :)

here is my code to add

all i want is to inherit the primary key to other table in order for me to join them

                'first_name'    =>  $first_name, 
                    'last_name'     =>  $last_name,
                'middle_name'   =>  $middle_name,
                'birth_date'    =>  $birth_date,
                'gender'        =>  $gender,
                'mobile_number' => $mobile_number,
                'hdo_id'        =>$hdo_id,
                'landline_number' => $landline_number,
                'provincial_address_1'=> $provincial_address1,
                'provincial_address_2'=> $provincial_address2,
                'current_address_1'=> $current_address1,
                'current_address_2' => $current_address2,
                'current_address_3' => $current_address3,
                 'personnel_id'=> Request::getClientPersonnelId(),


            'personnel_id' = \\i need to insert the value from personnel table
            'orgs_name' => $org_name,

i already resolve the issue thanks for help:D