Welcome Guest, Not a member yet? Register   Sign In
insert in to TIMESTAMP field using ActiveRecords
#1

[eluser]ningoo[/eluser]
I am trying to insert record in to profile table (see below) which has a column called 'lastlogin'.

The problem : CI inserts '0000-00-00 00:00:00' when i try to insert new record using active records.

my apologies , if i'm missing something thats obvious.

btw , thanks in advance

here's code
Code:
$profile_data = array(
              'member_id' => $member_id ,
              'membername' => $membername ,
              'profiledescription' => '' ,
              'lastlogin' => now(),
              'status' => 1,
                );
        
        $MAINDB->insert('profiles', $profile_data);

and heres table schema
Code:
create table `profiles` (
    `id` double ,
    `member_id` double ,
    `membername` varchar (96),
    `profiledescription` blob ,
    `created` timestamp ,
    `lastlogin` timestamp ,
    `status` double
);


Messages In This Thread
insert in to TIMESTAMP field using ActiveRecords - by El Forum - 09-25-2007, 01:59 PM
insert in to TIMESTAMP field using ActiveRecords - by El Forum - 09-25-2007, 02:04 PM
insert in to TIMESTAMP field using ActiveRecords - by El Forum - 09-25-2007, 02:08 PM
insert in to TIMESTAMP field using ActiveRecords - by El Forum - 09-25-2007, 02:24 PM
insert in to TIMESTAMP field using ActiveRecords - by El Forum - 09-26-2007, 07:44 AM
insert in to TIMESTAMP field using ActiveRecords - by El Forum - 09-26-2007, 07:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB