mentalist Posted March 26, 2009 Share Posted March 26, 2009 I've written some sort of db module and wondering if it's the right way to go about it. Basically once it's executed the query it then converts it into a standard php associative array. function db_do_mysql_query($s) { list($iret, $res) = _db_do_mysql_query($s); if($res == 1) { return -1; } $llret = array(); if ($iret == 0) { while ( $r = mysql_fetch_assoc($res) ) { $llret[] = $r; } return $llret; } else { return -1; } } Sooner or later i'll want to incorporate other db's other than mysql, but having no experience of other db's I thought i'd return the data in a generic way, the php array. Is this bad? Link to comment https://forums.phpfreaks.com/topic/151300-db-module/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.