Sorry for the delay...  i kinda missed your answer :-/

I seemed to have missed that one :o(   So yeah, i guess that will be the
problem. So i guess there are a few other ways of doing things.. ?

I could either do this with
 > ($row1, $row2, row3) = $query->fetchrow_array
 > $array_ref = $query->fetchrow_arrayref

OR... something that seems to me that will give me much cleaner code is with
bind_col...
my %rows = ();
$query = $dbh->prepare("SELECT id, name FROM mytable WHERE value=?");
$query->execute($myvalue);
$query->bind_col(1, \$rows{'name'});
$query->bind_col(2, \$rows{'id'});
while( $query->fetch ) {
  #do somthing with $rows{'name'
}

Would this be the best way to aprouch this ?


Groetjes,
Tiele Declercq [ [EMAIL PROTECTED] ]

---

Projectleider Start.be
http://start.be
----- Original Message -----
From: "Hardy Merrill" <[EMAIL PROTECTED]>
To: "Tiele Declercq" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, December 19, 2001 3:45 PM
Subject: Re: Memory leakage with fetchrow_hashref ?? [URGENT]


>            Currently, a new hash reference is returned for each
>            row.  This will change in the future to return the
>            same hash ref each time, so don't rely on the current
>            behaviour.
>
> So, currently a *new* hash reference is returned for each row -
> since memory is a concern, you may want to try one of the other
> fetch methods.



Reply via email to