Thanks for the response.

The documents table exists but I'm not having any issues with that
relationship as it's a simple has_many and belongs_to with my user
model.

The real issue is why, what appears to be a valid array is rendering
the way it is in the related users table on the view for the projects
page.

To get the array that's there I just did a print_r on the $users array
that is automatically generated by CakePHP.  As you can see there are
no missing keys and the hash lines up correctly with the data.

The thing I cannot figure out is why I have those garbage rows in the
table.  My database is clean.  It has 3 users with normal looking
data.  The projects_users join table is clean with:

user_id | project_id
3 | 1
2 | 1

The user_id associated with the table has a corresponding user as you
can see in the array.  So I'm not sure why it's chunking up data that
way it is in the related users table.

Any ideas?  Or can you think of anything specifically I should check
on outside of running the queries directly in SQL which I've done and
they return the correct data.  I think the problem is in the view or
how the users array is being interpreted possibly.

- Keith

On Oct 10, 6:48 pm, villas <[EMAIL PROTECTED]> wrote:
> Hi Keith
>
> Not sure you've provided enough info here,  and what we see looks a
> bit confusing.
> Is there also a 'documents' table?
> Did you set up a join table for the HABTM?
> What is the logic of having a Project belonging to a User in addition
> to using a join table so that many Projects may belong to a User?
> Maybe what you have written makes more sense to others,  but it
> suggests to me that you probably didn't read the book.cakephp.org
> carefully enough.  Have a good look again at the Models section and
> then post a followup question,  bearing in mind my comments above and
> we can try our best to assist you better.
>
> Kind regards.
>
> On Oct 10, 9:44 pm, Keith <[EMAIL PROTECTED]> wrote:
>
> > I am running into a strange issue when I've got the following model
> > structure:
>
> > User:
> > Has_Many: Projects
> > HABTM: Projects
>
> > Projects:
> > Belongs_To: User
> > HABTM: Users
>
> > So...everything works fine.  When I create a new project and select
> > multiple users they are indeed associated with the project as is the
> > correct user who "owns' the project as per the Belongs_To model
> > relationship.
>
> > However...
>
> > In the scaffolded view I get a really strange result that the SQL
> > query doesn't actually generate when I run it in SQL...
>
> > I get a really bizarre output in the Related Users.  Here's a
> > screenshot:http://www.keithmedlin.com/habtm_error.png
>
> > Any idea on why I've got what looks like a normal array rendering
> > pretty garbled?
>
> > I've run the SQL from the debug mode and the output looks exactly like
> > I expect it should look with the 2 users Rich & Lisa associated with
> > the document properly.
>
> > Thank you in advance for any help you might be able to provide!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to