Liam Delahunty: Home Tips Web Contact
Recommended laptop
under £500
.

Think I deserve a present? See my Amazon Wish List


$query = "SHOW COLUMNS FROM table_name ";
$result = mysql_query($query, $connection);
while ($myrow = mysql_fetch_row($result)) {
$cols[] = $myrow[0];
}

$query = "SELECT * FROM table_name";
$result = mysql_query($query, $connection);
while ($data = mysql_fetch_row($result)) {
for ($i=0; $i < count($cols); $i++) {
$colNames = $cols[$i];

print ("print ("");
print ("<tr><td>");
print ("$colNames");
print ("</td>");
print ("<td>");
print ("<input type=\"text\" name=\"$colNames\" value=\"$$colNames\">");
print ("</td>");
print ("</tr>");
print ("\\n");");
print ("
");
}
}

Share this!