Ver Mensaje Individual
  #7 (permalink)  
Antiguo 20/10/2004, 11:21
Avatar de Reynier
Reynier
 
Fecha de Ingreso: noviembre-2002
Ubicación: Por ahí en algún sitio
Mensajes: 1.844
Antigüedad: 21 años, 5 meses
Puntos: 1
Mira esto

Esto es lo que he logrado hasta ahora Cluster:
Código PHP:
<?php
 mysql_connect
("localhost","root","administrator");
 
mysql_select_db("oclae");
 
$dbname "oclae";
 
$listtables mysql_list_tables($dbname);
 while (
$tables mysql_fetch_row($listtables)){
  
$sql "CREATE TABLE(".$tables[0].") (";
  
$listfields mysql_list_fields($dbname,$tables[0]);
  
$query "SELECT * FROM ".$tables[0]."";
  
$result mysql_query($query) or die(mysql_error());
  
$columnes mysql_num_fields($listfields);
  echo 
"<strong>".$tables[0]."</strong><br>";
  for(
$i=0$i<$columnes$i++){
   echo 
"Name: ".mysql_field_name($result,$i)." Type: ".mysql_field_type($result,$i)." Lenght: ".mysql_field_len($result,$i)."<br>";
  }
 }
?>
esto me devuelve esto:
Cita:
administradores
Name: idusr Type: int Lenght: 6
Name: nombre Type: string Lenght: 25
Name: correo Type: string Lenght: 250
Name: login Type: string Lenght: 200
Name: passwd Type: blob Lenght: 255
Name: level Type: int Lenght: 3
Name: feadministradores
Name: idusr Type: int Lenght: 6
Name: nombre Type: string Lenght: 25
Name: correo Type: string Lenght: 250
Name: login Type: string Lenght: 200
Name: passwd Type: blob Lenght: 255
Name: level Type: int Lenght: 3
Name: fecha_registro Type: datetime Lenght: 19
Name: ultima_visita Type: datetime Lenght: 19
Name: sessionid Type: string Lenght: 255
Name: activo Type: int Lenght: 1
menu
Name: idmenu Type: int Lenght: 6
Name: idioma Type: int Lenght: 1
Name: titulo Type: string Lenght: 50
Name: span Type: string Lenght: 250
Name: direccion Type: string Lenght: 250
Name: tipo Type: int Lenght: 1
Name: orden Type: int Lenght: 3
Name: activo Type: int Lenght: 1
usuarios
Name: idusr Type: int Lenght: 6
Name: nombre Type: string Lenght: 25
Name: correo Type: string Lenght: 250
Name: login Type: string Lenght: 200
Name: passwd Type: blob Lenght: 255
Name: level Type: int Lenght: 3
Name: fecha_registro Type: datetime Lenght: 19
Name: ultima_visita Type: datetime Lenght: 19
Name: sessionid Type: string Lenght: 255
Name: activo Type: int Lenght: 1
cha_registro Type: datetime Lenght: 19
Name: ultima_visita Type: datetime Lenght: 19
Name: sessionid Type: string Lenght: 255
Name: activo Type: int Lenght: 1
menu
Name: idmenu Type: int Lenght: 6
Name: idioma Type: int Lenght: 1
Name: titulo Type: string Lenght: 50
Name: span Type: string Lenght: 250
Name: direccion Type: string Lenght: 250
Name: tipo Type: int Lenght: 1
Name: orden Type: int Lenght: 3
Name: activo Type: int Lenght: 1
usuarios
Name: idusr Type: int Lenght: 6
Name: nombre Type: string Lenght: 25
Name: correo Type: string Lenght: 250
Name: login Type: string Lenght: 200
Name: passwd Type: blob Lenght: 255
Name: level Type: int Lenght: 3
Name: fecha_registro Type: datetime Lenght: 19
Name: ultima_visita Type: datetime Lenght: 19
Name: sessionid Type: string Lenght: 255
Name: activo Type: int Lenght: 1
pero no se como concatenar la consulta y tampoco se como coger si el campo es NOT NULL, AUTOINCREMENT y esas propiedades específicas.
Salu2
__________________
Ing. Reynier Pérez Mira