php:sqldo
- sqldo.php
function sqldo($query, $howparse = "", $querydb = "") { // DB change for the query? if (!empty($querydb)) { $retvar = mysql_db_query($querydb, $query) or die("x203 - ".mysql_error()); } else { // Otherwise just do the query $retvar = mysql_query($query) or die("x203 - ".mysql_error()); } // Parse the query as requested (if requested :P) if ($howparse == "fetch_array") { $rows = array(); while ($row = mysql_fetch_assoc($retvar)) { $rows[] = $row; } if (!empty($rows)) { return $rows; } else { return; } } else if ($howparse == "fetch_assoc") { return mysql_fetch_assoc($retvar); } return $retvar; }
php/sqldo.txt · Last modified: 2015/08/15 22:56 by 127.0.0.1