so i'm trying to automatically create forms from database tables an its going ok but i can't get hold of the comments i've made for each field which i want to use as the fields' explanation text.
the table exports like this;
CREATE TABLE episodes (
episodeId int(11) NOT NULL auto_increment COMMENT 'main id number',
episodeTitle varchar(200) NOT NULL default '' COMMENT 'the title of the series',
episodeInfo text NOT NULL COMMENT 'episode info',
seriesRef int(4) NOT NULL default '0' COMMENT 'series reference',
episodeNo int(4) NOT NULL default '0' COMMENT 'episode number',
timestamp timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP COMMENT 'last updated',
PRIMARY KEY (episodeId)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=16 ;
and i'm after the COMMENT 'main id number' part of each field too.
and when i use;
$result = mysql_list_tables($db);
if (!$result) {
echo "DB Error, could not list tables";
echo 'MySQL Error: ' . mysql_error();
exit;
}
while ($row = mysql_fetch_row($result)) {
echo "<BR>Table: $row[0] <br>";
$resultb = mysql_query("SHOW COLUMNS FROM $row[0]");
if(!$resultb) {
echo 'Could not run query: ' . mysql_error();
exit;
}
if (mysql_num_rows($resultb) > 0) {
while ($row = mysql_fetch_assoc($resultb)) {
print_r($row);
echo "<BR>";
}
}
}
i get all the info except the comment. see here;
http://78.136.37.130/flash/tables.php
Any idea how i might get hold of the comment?
many thanks, D.