Mysql Fetch All


/ Published in: PHP
Save to your folder(s)

Simple but utilitarian function returns a numeric array of associative arrays containing an entire result set.


Copy this code and paste it in your HTML
  1. <?php
  2. /*
  3. mysql_fetch_all
  4.  
  5. Absurdly simple but utilitarian function returns a numeric array of associative arrays containing an entire result set.
  6. */
  7. function mysql_fetch_all($result) {
  8. $all = array();
  9. while ($all[] = mysql_fetch_assoc($result)) {}
  10. return $all;
  11. }
  12. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.