Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8315553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:09:29+00:00 2026-06-08T21:09:29+00:00

Sorry for the vague title, if anyone would like to edit it to reflect

  • 0

Sorry for the vague title, if anyone would like to edit it to reflect more about what I am posting, please do so. Here is the situation. I have 3 tables:

support:

id | contact_id | title | problem | etc

supportlogin:

id | contact_id | login | pass | etc

contact:

id | first_name | last_name | email | etc

I am loading the support bean just fine, and am accessing the contact info:

$support=R::load('support',1);
echo $support->contact->first_name;

I want to echo the supportlogin information similarly:

echo $support->contact->ownSupportlogin->login;

Is this possible, and am I doing it the right way? I have tried the following ways with no success:

echo $support->contact->supportlogin->login;
echo $support->contact->ownSupportlogin->login;
echo $support->contact->ownSupportlogin[0]->login;

EDIT: MORE INFO
I did print_r($support->contact) and was given the data:

RedBean_OODBBean Object
(
    [null:RedBean_OODBBean:private] => 
    [properties:RedBean_OODBBean:private] => Array
        (
            [id] => 109
            [phone] => 1234580970
            [first_name] => Tim
            [last_name] => Withers
        )

    [__info:RedBean_OODBBean:private] => Array
        (
            [type] => contact
            [sys.id] => id
            [tainted] => 
        )

    [beanHelper:RedBean_OODBBean:private] => RedBean_BeanHelperFacade Object
        (
        )

    [fetchType:RedBean_OODBBean:private] => 
)

And then I did print_r($support->contact->ownSupportlogin) and this showed up:

Array
(
    [13] => RedBean_OODBBean Object
        (
            [null:RedBean_OODBBean:private] => 
            [properties:RedBean_OODBBean:private] => Array
                (
                    [id] => 13
                    [link] => fecd4ef67e8c789efa1792f9ee0efff4
                    [login] => 
                    [password] => 
                    [receiveemails] => 1
                    [contact_id] => 109
                    [role] => 1
                )

            [__info:RedBean_OODBBean:private] => Array
                (
                    [type] => supportlogin
                    [sys.id] => id
                    [tainted] => 
                )

            [beanHelper:RedBean_OODBBean:private] => RedBean_BeanHelperFacade Object
                (
                )

            [fetchType:RedBean_OODBBean:private] => 
        )

)

I can access it using: echo $support->contact->ownSupportlogin[13]->login;, but doing it dynamically seems to be a problem….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T21:09:30+00:00Added an answer on June 8, 2026 at 9:09 pm

    Figured it out, and will leave it up in case anyone else has a similar problem:

    This will only work if you have a 1:1 relationship. Redbean populates the ownSupportlogin as an array of all supportlogin rows related to the contact. If one table can have many child tables, then you will need to loop through that array and pull out the data you want. If it is a 1:1 relationship, then you can use PHP’s reset() to access the data of the first element in the array:

    echo reset($support->contact->ownSupporlogin)->login;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry about the vague question title, but I have these typedefs here: typedef std::list<AnimationKeyframe>
Sorry if the title sounds a bit vague. Stackoverflow posting newbie here. I have
Sorry for the vague title. Here's an example of what I'd like to do.
Sorry about a vague title, but here's what i am trying to do. I
Sorry about the extremely vague question title (any suggestions for improvements welcome) I have
Sorry for the vague title, if anyone can think of a better one please
Sorry for vague question title, i couldn't figure out something more specific. I have
Sorry about the vague title but I have a servlet with the following mapping
Sorry about the vague title, but i didnt know how to ask the question
Sorry about the vague question title, I just want to ascertain some things. Static

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.