Jump to content

Like Mysql_Fetch_Assoc() But Return All Rows At Once Instead


ckrudelux

Recommended Posts

<?php$rows = array();$query = mysql_query("SQL CODE");while($row = mysql_fetch_assoc($query)){$rows[] = row;}return $rows;?>

Is where a function for this which returns all rows instead of one at the time so I don't need to use a loop?

Link to comment
Share on other sites

Most likely, if something's not in the manual, it doesn't exist. You can make your own custom function, though.

function mysql_fetch_all($q) {  $a = array();  while($b= mysql_fetch_assoc($q)){    $a[] = $b;  }  return $a;}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...