On Tue, 10 Aug 2004 10:31:36 -0400, Dan Joseph <[EMAIL PROTECTED]> wrote:
> Hi Everyone,
> 
>             I'm trying to build a class to handle various SQL functions.
> One of them is to take a query, and return all rows.  Here's what I have so
> far:
> 
> function selectRows( $sql )
> 
> {
> 
>             $count = 0;
> 
>             $results  = mysql_query( $sql, DB::connect() );
> 
>             $data     = mysql_fetch_array( $results );
> 
>             return $data;
> 
> }
> 
>             Right now it only returns 1 row.  I'm guessing this is how it
> should be, considering I haven't looped thru any other rows.
> 
>             What I want to do is return something that holds all the rows,
> however, I cannot see a decent way of doing this.  I've played with putting
> it into a new array, but I can't decide if that's the best way to do it.
> 
>             Wondering if I could get some opinions on how you all would
> handle this?
> 
> -Dan Joseph
> 

Of course, this begs the question of why you're re-implementing what
has been done so many times in the past.

http://pear.php.net/package/DB
http://pear.php.net/package/MDB
http://pear.php.net/package/MDB2
http://adodb.sourceforge.net/
http://www.phpclasses.org/browse/package/20.html

etc....

-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to