Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getHtmlTable($result){
- // receive a record set and print
- // it into an html table
- $out = '<table>';
- for($i = 0; $i < mysql_num_fields($result); $i++){
- $aux = mysql_field_name($result, $i);
- $out .= "<th>".$aux."</th>";
- }
- while ($linea = mysql_fetch_array($result, MYSQL_ASSOC)) {
- $out .= "<tr>";
- foreach ($linea as $valor_col) $out .= '<td>'.$valor_col.'</td>';
- $out .= "</tr>";
- }
- $out .= "</table>";
- return $out;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement