Re: liveuser_admin - storing extra data
| From: | Lukas Smith | Date: | Thu, 13 Oct 2005 12:36:56 +0000 |
| Subject: | Re: liveuser_admin - storing extra data | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-21440@lists.php.net to get a copy of this message | ||
Jeroen Houben wrote:
Hi,
I'm trying to add some extra data to the users table.
I modified my $conf array by adding this:
'storage' => array(
'dsn' => LIVEUSER_DSN,
'prefix' => 'lu_',
'tables' => array(
'users' => array(
'fields' => array(
'lastlogin' => null,
'is_active' => true,
'fname' => null,
'lname' => null,
'org' => null
),
),
),
possible values are "false" to denote the field is optional, "true" if the field is required or a string if it should have a unique index.
'fields' => array(
'lastlogin' => 'timestamp',
'is_active' => 'boolean',
'fname' => 'varchar',
'lname' => 'varchar',
'org' => 'varchar'
),
),
you seem to be missing the alias array for each of your fields.
I also added these fields manually to the database.
Looking at my conf is_active should just default to TRUE..We do not have support for default values in this way. However do have the following: In generateSchema() you can pass in an optional key (name of the fields) value pairs of default values. Note that in this case you need to make the given field optional (set it to false in the table=>fields array) or otherwise the client side (in the liveuser admin code) will not allow you to not set a value. regards, Lukas