have created a list of tables and their rows in one file. but it gives me load of unwanted informations. how can i just pull out a certain piece of the row info, just the field name for example?
code so far-
<?PHP
include("hg_start.php");
$connection_l = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
mysql_select_db($db) or die ("Unable to select database!");
$result = mysql_list_tables($db);
if (!$result) {
echo "DB Error, could not list tables\n";
echo 'MySQL Error: ' . mysql_error();
exit;
}
while ($row = mysql_fetch_row($result)) {
echo "<BR><b>Table: $row[0]</b><BR>";
$resultx = mysql_query("SHOW COLUMNS FROM $row[0]");
if(!$resultx) {
echo 'Could not run query: ' . mysql_error();
exit;
}
if (mysql_num_rows($resultx) > 0) {
while ($rowx = mysql_fetch_assoc($resultx)) {
print_r($rowx);
}
}
}
which gives info like this for each table...
Table: pictures
Array ( [Field] => synchDel [Type] => smallint(6) [Null] => [Key] => [Default] => 0 [Extra] => ) Array ( [Field] => synchRec [Type] => datetime [Null] => YES [Key] => MUL [Default] => [Extra] => ) Array ( [Field] => ipcode [Type] => char(9) [Null] => [Key] => MUL [Default] => [Extra] => ) Array ( [Field] => ipicfile [Type] => char(16) [Null] => [Key] => PRI [Default] => [Extra] => ) Array ( [Field] => itype [Type] => char(2) [Null] => [Key] => [Default] => [Extra] => ) Array ( [Field] => ipicname [Type] => char(20) [Null] => [Key] => [Default] => [Extra] => ) Array ( [Field] => iregister [Type] => datetime [Null] => [Key] => MUL [Default] => 0000-00-00 00:00:00 [Extra] => ) Array ( [Field] => iamend [Type] => datetime [Null] => [Key] => MUL [Default] => 0000-00-00 00:00:00 [Extra] => ) Array ( [Field] => ipicsent [Type] => tinyint(1) [Null] => [Key] => [Default] => 0 [Extra] =>