How to get the Names of the columns in MYSQL
I'm new to PHP and I want to get the column names of a table.The following
code doesn't return any errors, but it doesn't show any columns names
either.
Can anyone see what mistake I'm making please>
<?php
$q = "SELECT column_name FROM USER_TAB_COLUMNS WHERE table_name =
'!!mytablename!!'";
$real_q = mysql_query($q);
foreach ($r = mysql_fetch_row($real_q) as $taxokey => $taxovalue ) {
if ($taxokey != 'name') {
?>
<option value="<?php print($taxokey);?>"><?php
print($taxovalue);?></option>
<?php
}
}
?>
No comments:
Post a Comment