User Tools

Site Tools


php:sqldo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
php:sqldo [2013/12/17 09:39] biggiphp:sqldo [2015/03/20 09:14] biggi
Line 1: Line 1:
-<file php 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; 
-                } 
-                return $rows; 
-        } else if ($howparse == "fetch_assoc") { 
-                return mysql_fetch_assoc($retvar); 
-        } 
- 
-        return $retvar; 
-} 
-</file> 
php/sqldo.txt · Last modified: 2015/08/15 22:56 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki