Ver Mensaje Individual
  #15 (permalink)  
Antiguo 05/05/2006, 07:50
Avatar de KAT_Ayanami
KAT_Ayanami
 
Fecha de Ingreso: agosto-2004
Mensajes: 97
Antigüedad: 19 años, 7 meses
Puntos: 1
A ver, ejercicio 1:


esto no imprime nada
Código:
<?
function mysql_fetch_all($result) {
   $i = 0;
   for ($i=0; $i<mysql_num_rows($result); $i++) {
       $return[$i] = mysql_fetch_array($result);
   }
   return $return;
}
echo $return;
echo $result;
?>
esto da este error:
Could not run query: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM users' at line 1
Código:
<?php
$result = mysql_query("SELECT all FROM users");
if (!$result) {
   echo 'Could not run query: ' . mysql_error();
   exit;
}
$row = mysql_fetch_row($result);

echo $row[0]; 
echo $row[1];
?>
ya con las otras tareas ni os cuento... amos tios que estoy con la mierda hasta el cuello...
Kat.
__________________
·