The mainButton()function uses the value of $mainProgramto build
October 27, 2006 on 6:14 pm | In php |$output = ?; $result = mysql_query($query, $dbConn); //print dbConn is $dbConn
?; //print result is $result
?; while ($row = mysql_fetch_assoc($result)){ foreach ($row as $col=>$val){ $output .= $col: $val
\n ?; } // end foreach$output .=
\n ? ; } // end whilereturn $output; } // end qToListBuilding an HTML Table from a QueryThe qToTable()function is a little more powerful than qToList(). It can build an HTML table from any valid SQL SELECTstatement. The code uses themysql_fetch_field()function to determine field names from the query result. Italso steps through each row of the result, printing an HTML row correspondingto the record. function qToTable($query){ //given a query, automatically creates an HTML table outputglobal $dbConn; $output = ?; $result = mysql_query($query, $dbConn); $output .=
| $field->name |
|---|