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

  • Home
  • SEARCH
  • 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 7814101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:05:22+00:00 2026-06-02T05:05:22+00:00

I have the following two queries: $query = $this->doctrine->em->createQuery(select u from ORM\Dynasties2\Characters u WHERE

  • 0

I have the following two queries:

$query = $this->doctrine->em->createQuery("select u from ORM\Dynasties2\Characters u WHERE u.whichFamily = $whichfamily AND (u.deathDate = 0 OR u.deathDate IS NULL) ");

and

$query = $this -> doctrine -> em -> createQuery ("SELECT a, b.msgText, b.fromUser, b.timeStamp, b.importance, b.msgType FROM ORM\Dynasties2\Maillinks a JOIN a.msgId b");

The first query returns an object.

array(9) { 
  [0]=> object(stdClass)#108 (18) {
    ["__CLASS__"]=> string(25) "ORM\Dynasties2\Characters" 
    ["id"]=> int(67) 
    (etc)

The second query returns an array.

array(4) {
  [0]=> array(6) { 
    [0]=> string(24) "ORM\Dynasties2\Maillinks"
    ["msgText"]=> string(24) "asdfasdfasdfasdfasdfasdf"  
    (etc)

Why does the second one return an array?

Is there a simple way to convert it into an object?

(using doctrine2 and codeigniter2)

Edit:

If I change the second query like so:

$query = $this -> doctrine -> em -> createQuery ("SELECT a FROM ORM\Dynasties2\Maillinks a JOIN a.msgId b");

then the output is an object. So I’ve partly answered my question – however, the above code does not return the data that I need.

  • 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-02T05:05:25+00:00Added an answer on June 2, 2026 at 5:05 am

    Try this (if the relationship is defined properly, it should return and object):

    SELECT a, b FROM ORM\Dynasties2\Maillinks a JOIN a.msgId b
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following two queries: select count(*) from segmentation_cycle_recipients scr , segmentation_instance si
I have two queries, as following: SELECT SQL_CALC_FOUND_ROWS Id, Name FROM my_table WHERE Name
I have two queries. The first query looks like this : SELECT subject_id, period,
I have the following two queries which I want to get in one query.
I have the following two columns: SELECT b.ip_address AS IP ,b.mask AS MASK FROM
I have the following query in mysql 5.1.41: select distinct table_schema from information_schema.tables where
right now I have the following query in a stored procedure. select * from
i have following two queries, one is create procedure query and other is the
I'm using parameterized queries with PHP I have the following two queries: SELECT username,question_text
I have the following two queries, I believe that the one that uses the

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.