\n"; $connection=mysql_connect($dbaddress,$dbuser,$dbpassword); if(!isset($dbuser)){ //new arrival echo "
\n"; echo "Host\t
\n"; echo "Name\t
\n"; echo "Pass\t
\n"; echo "
\n"; }else{ if(!isset($dbname)){ //$dbuser is set $dbs=mysql_list_dbs($connection); $numdbs=mysql_num_rows($dbs); for($i=0;$i<$numdbs;$i=$i+1){ $db=mysql_dbname($dbs,$i); echo "DB=".$db."
\n"; } }else{ if(!isset($dbtable)){ //$dbname is set $selection=mysql_select_db($dbname,$connection); $tables=mysql_list_tables($dbname,$connection); $numtables=mysql_num_rows($tables); for($i=0;$i<$numtables;$i=$i+1){ $table=mysql_tablename($tables,$i); echo "
"; echo "Table=".$table."
\n"; $fields=mysql_list_fields($dbname,$table,$connection); $numfields=mysql_num_fields($fields); echo "\n"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; for($j=0;$j<$numfields;$j=$j+1){ $field=mysql_field_name($fields,$j); $fieldtype=mysql_field_type($fields,$j); $fieldflags=mysql_field_flags($fields,$j); $fieldlen=mysql_field_len($fields,$j); echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } echo "
Field NameData TypeLengthFlags
Field=".$field."Type=".$fieldtype."Length=".$fieldlen."Flags=".$fieldflags."
\n"; } }else{ //$dbtable is set echo "\n"; $fields=mysql_list_fields($dbname,$dbtable,$connection); $numfields=mysql_num_fields($fields); echo "\n"; $query=""; for($i=0;$i<$numfields;$i=$i+1){ $field=mysql_field_name($fields,$i); $fieldname[$i]=$field; echo "\n"; } echo "\n"; $query="SELECT * FROM ".$dbtable; $result=mysql_query($query,$connection); $numrows=mysql_num_rows($result); for($i=0;$i<$numrows;$i=$i+1){ $row=mysql_fetch_row($result); echo "\n"; for($j=0;$j<$numfields;$j=$j+1){ if(""==$row[$j]){$row[$j]="_";} echo "\n"; } echo "\n"; } echo "
".$field."
".$row[$j]."
\n"; } } } echo "\n"; ?>