Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
About clarification:
You stubbornly do not want to look at PHP help. I cited the mssql_field_name function as an example, and, lo and behold, there is a one-to-one function with the name ... drum roll ... odbc_field_name which also returns the names of the columns based on the result of a query to the database.
Sorry, of course, but it's time for you to start fighting your own laziness.
If you use mysql_fetch_assoc , then you can make one query:
$res = mysql_query('select a, b, c from foo');
$row = mysql_fetch_assoc($res);
print '<table><tr>';
foreach($row as $name => $value) {
print "<th>$name</th>";
}
print '</tr>';
while($row) {
print '<tr>';
foreach($row as $value) {
print "<td>$value</td>";
}
print '</tr>';
$row = mysql_fetch_assoc($res);
}
print '</table>';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question