Google Groups Home
Help | Sign in
mysql_fetch_assoc
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Johnny  
View profile
 More options 3 Jul, 11:19
From: Johnny <ionut.dumi...@webland.ro>
Date: Thu, 3 Jul 2008 03:19:32 -0700 (PDT)
Local: Thurs 3 Jul 2008 11:19
Subject: mysql_fetch_assoc
hi,

i'm trying to do queries across multiple tables using DQL and need the
results in a mysql_fetch_assoc style.
Doctrine either hydrates the output into nested objects based on the
relations or throws a zero based index array. I tried with all
HYDRATE_ARRAY, HYDRATE_RECORD, HYDRATE_NONE.

is there some way to use such an option with dql?

example: (this was the only way i managed to get my fetch_assoc
vector)

                $results_query=Doctrine_Query::create()
                                                ->setHydrationMode(Doctrine::HYDRATE_ARRAY)
                                                ->select('p.id, p.player_name, b.band_name, u.user_name')
                                                ->from('PlayerResource p')
                                                ->leftJoin('p.Band b')
                                                ->leftJoin('p.User u')
                                                ->execute();

                $results=array();
                $i=0;
                foreach($results_query as $result_query)
                {
                        $results[$i]=array();
                        $results[$i]['id']=$result_query['id'];
                        $results[$i]['player_name']=$result_query['player_name'];
                        $results[$i]['band_name']=$result_query['Band']['band_name'];
                        $results[$i]['user_name']=$result_query['User']['user_name'];
                        $i++;
                }

thanks
Ionut


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Wage  
View profile
 More options 3 Jul, 14:58
From: "Jonathan Wage" <jonw...@gmail.com>
Date: Thu, 3 Jul 2008 08:58:10 -0500
Local: Thurs 3 Jul 2008 14:58
Subject: Re: [doctrine-user] mysql_fetch_assoc

This currently does not exist. We will be introducing a new hydration type
shortly called HYDRATE_SCALAR which I am pretty sure does the hydration you
are expecting.

- Jon

--
Jonathan Wage
http://www.jwage.com
http://www.centresource.com

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ionut Dumitru  
View profile
 More options 4 Jul, 13:49
From: "Ionut Dumitru" <ionut.dumi...@webland.ro>
Date: Fri, 4 Jul 2008 15:49:11 +0300
Local: Fri 4 Jul 2008 13:49
Subject: Re: [doctrine-user] Re: mysql_fetch_assoc

thanks for the reply Jon, i think that would be an awesome feature

Ionut


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google