(1)相关知识点
①查询:select column_name(s) from table_name
②mysqli_query() 函数执行一条 MySQL 查询
class="php">$result = mysqli_query($connect,"select* from user");
③结果集里行数,该结果集从mysql_query()的调用中得到
mysqli_num_rows($result);
④mysql_fetch_array() 函数以数组的形式从记录集返回第一行
⑤注意mysql_fetch_array()函数要直接放在while里,否则会无限循环
//查询结果 // mysqli_query() 函数执行一条 MySQL 查询 $result = mysqli_query($connect,"select* from user"); //结果集里行数,该结果集从 mysql_query() 的调用中得到 //mysqli_num_rows($result); echo "<table border=1 cellspacing=0>"; while($row = mysqli_fetch_array($result)){ echo "<tr>"; echo "<td>".$row['name']."</td>"; echo "<td>".$row['password']."</td>"; echo "<tr/>"; } echo "</table>";
?
?
?
?
?
?
.