Re: Auth and joins
| From: | Graham Clarke | Date: | Tue, 15 Nov 2005 21:21:18 +0000 |
| Subject: | Re: Auth and joins | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-21936@lists.php.net to get a copy of this message | ||
Gerard Bowe wrote:
Graham Clarke wrote:The view is an object your database -- like a table, but an SQL script that gives you a "view" into more than one table at a time.What if you create a view to the data you want? So your options array would be something like this -- $options = array(Sorry, but I'm not sure what you mean by create a view?'table' => 'myUserView','usernamecol'=> 'username', 'passwordcol'=> 'password','userid' => 'userid', 'db_fields' => [LIST OF COLUMNS YOU WANT STORED IN THE SESSION], 'dsn' => YOUR_DSN); Graham Gerard Bowe wrote:Is it possible to do a join with the Auth package (or send raw sql). I have three tables Users, Groups and UserGroups (a user may belong to one or more groups). I would like to get the group(s) when the user logs in and and register them in the SESSION. Thanks ger
I have the $options set up as above, but with fields from only one table. I would like to be able to all the data (username, id, groups, etc) and register it in the session, with just one call to the database?I'm not certain that this will work with AUTH, but the idea is that the view will give you the columns from the various tables you need. hth Graham -- Graham Clarke grahamc@53tech.com www.53tech.com 603.643.9955