View Single Post
Old 01-24-2012, 02:47 AM  
ewsmedia
Registered User
 
Industry Role:
Join Date: Jan 2012
Posts: 4
Best for rapid development is to use custom query functions like this

Code:
	function fetchAll($query = false, $key = false) {
		$fetch = false;

		if($query) {
			if($result = mQuery($query)) {
	    		while($res = mysql_fetch_assoc($result)) {

	    			if($key && $res[$key]) {
	    				$fetch[$res[$key]] = $res;
	    			} else {
	    				$fetch[] = $res;
	    			}
	    		}
	    	}
	    }

	    return $fetch;
	}
and than you can tune it all, you will not have your code doubled
ewsmedia is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote