Ver Mensaje Individual
  #12 (permalink)  
Antiguo 27/06/2014, 01:35
elitown87
 
Fecha de Ingreso: junio-2014
Mensajes: 101
Antigüedad: 9 años, 11 meses
Puntos: 0
Respuesta: Relación de variables

Cada vez que cambio algo me da más errores la página...no se en qué estaré metiendo la pata pero lo que está claro es que `".$fila['id']."`no me lo está reconociendo como el nombre de mi tabla, por la razón que sea =( Este es mi código, he utilizado tu sugerencia del uso in_array (también sin ella y tampoco sale):

Código PHP:
Ver original
  1. $query = "SELECT * FROM conectados";
  2.             $resultado = mysql_query($query);
  3.             $fila = mysql_fetch_array($resultado);
  4.            
  5.             $result = mysql_query("SHOW TABLES FROM `".$fila['id']."`");
  6.  
  7.             while($row = mysql_fetch_row($result)) {
  8.                 $tablas[] = $row[0];
  9.             }  
  10.  
  11.             while($fila = mysql_fetch_array($resultado)){
  12.                 if( in_array(`$fila['id']`, $tablas)){
  13.                    
  14.                     echo "</tr>";
  15.                
  16.                     echo "<td align = 'center'>";
  17.                     echo "<form action = 'insertar_contenido1.php' method = 'post' enctype = 'multipart/form-data'>";
  18.                     echo "<input type = 'file' name = 'cliente[]' multiple/><br/>";
  19.                     echo '<input type = "hidden" name = "mac_address" value = "'.$fila['id'].'">';
  20.                     echo '<input type = "hidden" name = "var_id" value = "'.$fila['id'].'" />';
  21.                     echo '<input type = "hidden" name = "var_MAC" value = "'.$fila['Dispositivos'].'" />';
  22.                     echo '<input type = "submit" name = "enviar" value = "Subir"/><br/>';
  23.                     echo "</form>";
  24.                     echo "</td>";
  25.                
  26.                     echo "<td align = 'center'>";
  27.                     echo "<form action = 'borrar_tabla.php' method = 'post'>";
  28.                     echo '<input type = "hidden" name = "mac_address" value = "'.$fila['id'].'">';
  29.                     echo '<input type = "hidden" name = "var_id" value = "'.$fila['id'].'" />';
  30.                     echo '<input type = "hidden" name = "var_MAC" value = "'.$fila['Dispositivos'].'" />';
  31.                     echo '<input type = "submit" value = "Borrar" />';
  32.                     echo "</form>";
  33.                     echo "</td>";
  34.                
  35.                     echo "<td>";
  36.                     echo "<form action = 'vnc.php' method = 'post'>";
  37.                     echo '<input type = "hidden" name = "mac_address" value = "'.$fila['id'].'">';
  38.                     echo '<input type = "submit" value = "Arrancar"/><br/>';
  39.                     echo "</form>";
  40.                     echo "</td>";
  41.                
  42.                     echo "<td align = 'center'>";
  43.                     echo "<form action = 'formulario_html.php' method = 'post'>";
  44.                     echo "<input type = 'submit' name = 'formulario' value = 'Usuario'/><br/>";
  45.                     echo "</form>";
  46.                     echo "</td>";
  47.                
  48.                     echo "</tr>";
  49.                 }
  50.             }

Estos son los fallos que me da:

Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\Trabajo\phpseleccionar2.php on line 17

Notice: Undefined variable: tablas in C:\xampp\htdocs\Trabajo\phpseleccionar2.php on line 22

Warning: in_array() expects parameter 2 to be array, null given in C:\xampp\htdocs\Trabajo\phpseleccionar2.php on line 22

Notice: Undefined variable: tablas in C:\xampp\htdocs\Trabajo\phpseleccionar2.php on line 22

Warning: in_array() expects parameter 2 to be array, null given in C:\xampp\htdocs\Trabajo\phpseleccionar2.php on line 22

No me sale ni un botón y tras comprobaciones, creo que no entra en nigún bucle... si se te ocurriera algo...muchas gracias de nuevo, y disculpa la insistencia!