網頁文章 javax.portlet.title.56

 <!-- 程式範例:Ch13-3-1.php -->

<html>
<head><title>查詢資料表的記錄資料</title></head>
<body>
<table border=1>
<?
 
$link = mysqli_connect("localhost","10179504",
                       "10179504","10179504");
        
$sql = "SELECT * FROM jqm_products";
 
if ( $result = mysqli_query($link, $sql) ) { 
   
   while( $row = mysqli_fetch_assoc($result) ){ 
      echo "<td>".$row["name"]."</td>". "<td>".$row["price"]."</td>"."<tr>";
   } 
  
   mysqli_free_result($result); 
mysqli_close($link);  
?>
</table>
</body>
</html>