Revision: 1222
Updated Code
at September 26, 2006 07:39 by gdonald
Updated Code
function sqlFetchArray( $query, $type='MYSQL_ASSOC' ) { if( in_array( 'mysql', $GLOBALS[ 'loaded_extensions' ] ) ) { switch( $type ) { case 'MYSQL_NUM': return @mysql_fetch_array( $query, MYSQL_NUM ); break; case 'MYSQL_ASSOC': return @mysql_fetch_array( $query, MYSQL_ASSOC ); break; case 'MYSQL_BOTH': return @mysql_fetch_array( $query, MYSQL_BOTH ); break; } } elseif( in_array( 'mysqli', $GLOBALS[ 'loaded_extensions' ] ) ) { switch( $type ) { case 'MYSQL_NUM': return @mysqli_fetch_array( $query, MYSQLI_NUM ); break; case 'MYSQL_ASSOC': return @mysqli_fetch_array( $query, MYSQLI_ASSOC ); break; case 'MYSQL_BOTH': return @mysqli_fetch_array( $query, MYSQLI_BOTH ); break; } } }
Revision: 1221
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at September 26, 2006 07:36 by gdonald
Initial Code
function sqlFetchArray( $query, $type='MYSQL_ASSOC' ) { if( in_array( 'mysql', $GLOBALS[ 'loaded_extensions' ] ) ) { switch( $type ) { case 'MYSQL_NUM': return @mysql_fetch_array( $query, MYSQL_NUM ); break; case 'MYSQL_ASSOC': return @mysql_fetch_array( $query, MYSQL_ASSOC ); break; case 'MYSQL_BOTH': return @mysql_fetch_array( $query, MYSQL_BOTH ); break; } } elseif( in_array( 'mysqli', $GLOBALS[ 'loaded_extensions' ] ) ) { switch( $type ) { case 'MYSQL_NUM': return @mysqli_fetch_array( $query, MYSQLI_NUM ); break; case 'MYSQL_ASSOC': return @mysqli_fetch_array( $query, MYSQLI_ASSOC ); break; case 'MYSQL_BOTH': return @mysqli_fetch_array( $query, MYSQLI_BOTH ); break; } } }
Initial URL
Initial Description
Initial Title
php mysql/mysqli fetch array
Initial Tags
mysql, php, array
Initial Language
PHP