Tema: Array PHP
Ver Mensaje Individual
  #4 (permalink)  
Antiguo 26/08/2009, 03:22
bomaye
 
Fecha de Ingreso: septiembre-2003
Ubicación: Madrid
Mensajes: 53
Antigüedad: 20 años, 8 meses
Puntos: 1
Respuesta: Array PHP

Cita:
Iniciado por zornak Ver Mensaje
Tengo un lio impresionante....

Tengo este codigo:

Código php:
Ver original
  1. <? if($_GET['funcion'] == "see_invetory")
  2. {
  3.     $char = $_GET['char_name'];
  4.     $owner_id = mysql_query("SELECT * FROM characters WHERE char_name=$char");
  5.     $row = mysql_fetch_assoc($owner_id);
  6.     $owner = $row['charid'];
  7.     $see_invetory = "SELECT * FROM items WHERE owner_id=$owner";
  8.     $resultado = mysql_query ($see_invetory);
  9.  
  10.     while ($array = mysql_fetch_array($resultado))
  11.    
  12.     {?>
  13.     <table width="600" border="0" cellspacing="5">
  14.     <tr>
  15.         <td width="405">Objeto</td>
  16.         <td width="70">Cantidad</td>
  17.         <td width="99">Enchant</td>
  18.     </tr>
  19.     <tr>
  20.         <td width="405"><?php echo $array["item_id"]?></td>
  21.         <td width="70"><?php echo $array["count"]?></td>
  22.         <td width="99"><?php echo $array["enchant_level"]?></td>
  23.     </tr>
  24. </table>
  25. <?}}?>


¿Que tengo mal?

Buenas, según veo, cambia mysql_fetch_array($resultado)) por mysql_fetch_assoc($resultado)).

Saludos.