Mira, lo he hecho así:
Código PHP:
$conexion2=mysql_connect($dbserver,$dbuser,$dbpass);
mysql_select_db($db,$conexion2);
$sql2="SELECT * FROM gap_chat_conversaciones WHERE fecha LIKE '".$fecha."' AND hora>'".$_GET['conexion']."' AND sala=".$sala." ORDER BY id DESC LIMIT 0,40;";
$result2=mysql_query($sql2,$conexion2);
$array = array();
while ($row = mysql_fetch_assoc($result2))
{
$array[] = array("sala" => $row["sala"], "mensaje" => $row['mensaje'], "fecha" => $row['fecha'], "hora" => $row['hora'], "user" => $row['user']);
}
$array = array_reverse($array);
echo "<pre>";
print_r($array);
echo "</pre>";
Este es el resultado:
Warning: array_reverse() [function.array-reverse</a>]: The argument should be an array in ****.php on line 16