M.O.S. Studios Posted June 29, 2009 Share Posted June 29, 2009 hey, I made this simple function function mysql_fullarray($resource) { while($array=mysql_fetch_array($resource)) { $return_array[]=$array; } return $return_array; } it returns each value twice, one time with the key, one time with a number instread of the key, like the following [0] => Array ( [0] => 44 [index] => 44 [1] => test [name] => test [2] => 1 [internal] => 1 [3] => test.php [inlink] => test.php [4] => [exlink] => [5] => 0 [header] => 0 [6] => 100 [sort] => 100 [7] => 1 [act] => 1 ) i was thinking i could stop it using is_numeric, but that will get rid of keys that have a numeric name, any ideas??? thanks in advance! Link to comment https://forums.phpfreaks.com/topic/164169-show-full-array-funtion-i-am-working-on/ Share on other sites More sharing options...
HPWebSolutions Posted June 30, 2009 Share Posted June 30, 2009 The following is from the PHP.NET reference: By using MYSQL_BOTH (default), you'll get an array with both associative and number indices. Using MYSQL_ASSOC, you only get associative indices (as mysql_fetch_assoc() works), using MYSQL_NUM, you only get number indices (as mysql_fetch_row() works). For more information on this, see http://us.php.net/mysql_fetch_array Link to comment https://forums.phpfreaks.com/topic/164169-show-full-array-funtion-i-am-working-on/#findComment-866076 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.