Hello all,

This is my first post here and it is a weird problem that I have been
trying to fix for a few days now with no luck.  I have a HABTM that is
connecting a poker tournament table with a users table so that I can
track which users were at the poker tournament.  When I run the HABTM
I end up getting the first user's data, each field, in a separate
element in the array, then I get the users in the array the proper
way.  Here is my code:

var $hasAndBelongsToMany = array('User' =>
    array('className'    => 'User',
        'joinTable'    => 'users_poker',
        'foreignKey'   => '',
        'associationForeignKey'=> '',
        'conditions'   => '',
        'order'        => '',
        'limit'        => '',
        'unique'       => true,
        'finderQuery'  => '',
        'deleteQuery'  => '')
    );

It is a very basic HABTM so I left most things default.  In the
tournament method for my poker controller I have:

        function tournament($id)
        {
                $this->checkSession();
                $this->pageTitle = 'Tournament';
                $this->set('poker',$this->Poker->findById($id));
        }

Then in the tournament view I have:

<h1>Tournament</h1>
<hr />
<?php
foreach($poker['User'] as $user):
        echo $user['username'];
        echo "<br/>";
endforeach;
?>

When it prints out I end up getting something that looks like:

1
B
S
d
f
2
1
1
7
fallenrayne
carrie

Of course only the last 2 rows are actually correct, the rest of the
rows are the first character of each field in the row for my username.

Just curious if anyone else has seen this problem before and might be
able to lead me in the right direction.

Thank you for your help in advance and I appreciate the great work you
guys have done with this framework.  I switch back and forth from a
J2EE Struts MVC framework at work, to this one at home, so please
excuse me if I accidentally mix up conventions or coding styles.
Again, thanks for the help.


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to