$query = MysqL_query("SELECT * FROM mytable"); while ($row = MysqL_fetch_assoc($query)) { //How to echo column names and values here? }
是否可以在while循环中遍历整个表时回显表的列名和值?
$query = MysqL_query("SELECT * FROM mytable"); while ($row = MysqL_fetch_assoc($query)) { foreach($row as $key => $value) { print "$key = $value <br />"; } }