This isn't a bug, or even a problem.
Cake unifies all database systems with a consistent API. When
returning result sets, certain database systems (like mysql) identify
the originating table for each field, whereas others don't.
CakePHP needs that information to decide which array to place the
result field in, for queries using joins.
If the database does not support retrieving the table information,
cake fakes it by imposing a certain format on the field aliases
(Table__field) and extracts them later. You never see the aliases
except in the SQL log.
Bottom line: leave it be, it's supposed to be like this.
On Feb 6, 4:06 pm, hellfish <[EMAIL PROTECTED]> wrote:
> Right now I'm going forward using mysql, but my company only provides
> sql server so it's going to be interesting in a few days.
>
> I wasn't able to find any fixes to that problem.
>
> On Feb 6, 3:15 pm, TracyB <[EMAIL PROTECTED]> wrote:
>
> > this is under the adodb driver for access. I have another model using
> > an access database, and that one doesn't seem to be doing this. did
> > you find a fix, or did you just switch to a different database?
>
> > On Feb 6, 10:14 am, hellfish <[EMAIL PROTECTED]> wrote:
>
> > > I had a similar problem while using adodb driver and odbc_mssql. While
> > > using mysql worked ok.
>
> > > What driver are you using?
>
> > > On Feb 6, 1:48 pm, TracyB <[EMAIL PROTECTED]> wrote:
>
> > > > I'm trying to go through the Example: Simple User Authentication in
> > > > the CakePHP manual, to learn how to set up my own authentication for a
> > > > website. The database that I have to use for authentication is a
> > > > legacy Access database, and I have connected to it successfully with
> > > > Cake already. For some reason, when I try to login, the query that
> > > > gets generated is a little screwy.
>
> > > > It generates: SELECT "User"."AccName" AS "User__AccName" AS
> > > > "User"__"AccName" AS "User__AccName", "User"."AccPass" AS
> > > > "User__AccPass" AS "User"__"AccPass" AS "User__AccPass",
> > > > "User"."FirstName" AS "User__FirstName" AS "User"__"FirstName" AS
> > > > "User__FirstName", "User"."Surname" AS "User__Surname" AS
> > > > "User"__"Surname" AS "User__Surname", "User"."ContactID" AS
> > > > "User__ContactID" FROM "registrar" AS "User" WHERE "User"."acc_name" =
> > > > 'dev' LIMIT 1
>
> > > > I don't understand why it's repeating the "AS" so many times, I
> > > > haven't seen that before in any of the generated queries.
>
> > > > My model is fairly simple:
> > > > class User extends AppModel
> > > > {
> > > > var $name = 'User';
> > > > var $useTable = 'registrar';
> > > > var $primaryKey = 'ContactID';
> > > > var $useDbConfig = 'orderflow';
> > > > var $hasMany = 'Order';
>
> > > > }
>
> > > > Is there something remarkably stupid that I'm doing that I'm just not
> > > > aware of?
>
> > > > Thanks,
> > > > Tracy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---