<html>
<body>
<table>
<tr>
<td>
<?php
   $connect=mysql_connect($hostname,$username,$password);
   $query="selcect * from table_name";
   $r=mysql_db_query($database,$query);
   $row=mysql_fethch_array($r);
   $field1=$row["field1"];
?>
</td>
</tr>
</table>
</body>
</html>

解决方案 »

  1.   

    类似于ODBC函数库的odbc_result_all函数,调试mysql应用很有用的。function mysql_result_all($result,$format="") {
      echo "<table $format><tr>";
      for($i=0;$i<mysql_num_fields($result);$i++) {
        echo "<th>".mysql_field_name($result,$i)."</th>";
      }
      echo "</tr>";
      while($row = mysql_fetch_row($result)) {
        echo "</tr>";
        for($i=0;$i<mysql_num_fields($result);$i++) {
          echo "<td>".$row[$i]."</td>";
        }
        echo "</tr>";
      }
      echo "</table>";
    }  
      

  2.   

    <tr>
      <td>字段1</td><td>字段2</td><td>字段3</td>
    </tr>
    <tr>
      <td>值1</td><td>值1</td><td>值1</td>
    </tr>
    总之和普通的没区别!
      

  3.   

    <html><body><table><tr>
    <?php
       $connect=mysql_connect($hostname,$username,$password);
       $query="selcect * from table_name";
       $r=mysql_db_query($database,$query);
       while($row=mysql_fethch_array($r)){
       $field1=$row["field1"];
       $field1=$row["field2"];
       ...
       echo "<td>$filed1</td>";
       echo "<td>$filed2</td>";
       echo "<td>...</td>";
    ?>
    </tr></table></body></html>
      

  4.   

    sorry!
    while($row=mysql_fethch_array($r)){
       $field1=$row["field1"];
       $field1=$row["field2"];
       ...
       echo "<td>$filed1</td>";
       echo "<td>$filed2</td>";
       echo "<td>...</td>";
    }