Google Groups Home
Help | Sign in
Message from discussion mysql_fetch_assoc
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
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

On Thu, Jul 3, 2008 at 5:19 AM, Johnny <ionut.dumi...@webland.ro> wrote:

> 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

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

    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.

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