RE: [PEAR] Trying to loop through MDB rowset -
| From: | Lukas Smith | Date: | Thu, 07 Nov 2002 16:57:51 +0000 |
| Subject: | RE: [PEAR] Trying to loop through MDB rowset - | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-2658@lists.php.net to get a copy of this message | ||
> From: Switzer, Mike [mailto:MSwitzer@ChoiceOneCom.com]
> Sent: Thursday, November 07, 2002 5:59 PM
> To: 'pear-general@lists.php.net'
> Subject: RE: [PEAR] Trying to loop through MDB rowset -
>
> Originally posted by Matt Friedman:
> ------------------------------------------------
> I had thought that this would work ok:
> ---
> $sql = " SOME SQL HERE ";
> $rs = $this->db->query($sql);
> while( $row = $this->db->fetchRow($rs, MDB_FETCHMODE_ASSOC) ) {
> // do something with the row info...
> }
> ---
>
> But I keep getting this error and I can't seem to reckon why.
>
> Notice: Undefined offset: 19 in /usr/local/lib/php/MDB/mysql.php on
line
> 1343
> -------------------------------------------------
>
>
> Try this -
>
> while( $row = $this->db->fetchRow($rs, DB_FETCHMODE_ASSOC) ) {
>
> ^--- no M
Actually that was correct ... MDB has a different prefix for it's
constant than DB ...
See my other mail for further details on how to get rid of the above
problem that Matt is experiencing.
Regards,
Lukas