Ver Mensaje Individual
  #3 (permalink)  
Antiguo 08/08/2013, 20:19
Avatar de xSkArx
xSkArx
 
Fecha de Ingreso: marzo-2008
Ubicación: Chile
Mensajes: 945
Antigüedad: 16 años, 1 mes
Puntos: 96
Respuesta: Guardar los nombre de campos de una tabla en un array

Cita:
Iniciado por Erick_MD9 Ver Mensaje
Hola podrias usar "describe" de Mysql

include('config.php');
$q2 = "describe noticias";
$result = mysql_query($q2,$conexion);
while ($line = mysql_fetch_assoc($result)) {
$arrayc[]=$line["Field"];
}

Espero te sea de ayuda.
gracias, pero me da errores mira:

Código Error:
Ver original
  1. Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\prueba.php on line 7
  2.  
  3. Notice: Undefined variable: arrayc in C:\xampp\htdocs\prueba.php on line 11
  4.  
  5. Warning: in_array() expects parameter 2 to be array, null given in C:\xampp\htdocs\prueba.php on line 11