Thread: fetch function
View Single Post
Old 09-27-2007, 11:42 PM   #1 (permalink)
Haris
The Frequenter
Prolific Welcomer Upcoming Programmer 
 
Join Date: Sep 2007
Posts: 360
Thanks: 24
Haris is on a distinguished road
Default fetch function

I have a fetch function in my database class which only echo's out one value (I reckon the last added value but that's not what I want to do. I want to fetch all the values in the array not only the last added value.

How can I achieve this with functions? :confused:

PHP Code:
        /*
         * Summary:     Fetches the result from the datbase in an array
         * Parameters:  SQL Statement
         * Return:      Returns an array of strings that corresponds to the fetched rows
         */
        
        
public function fetch($szSQL){
            
$szResult mysql_query($szSQL);
            
$aResult mysql_fetch_array($szResultMYSQL_ASSOC);
            return 
$aResult;
        } 
Haris is offline  
Reply With Quote