PHP read data

(1) Relevant knowledge points

①查询:select column_name(s) from table_name

②mysqli_query() function executes a MySQL query

$result = mysqli_query($connect,"select* from user");

③ The number of rows in the result set, which is obtained from the call of mysql_query()

mysqli_num_rows($result);

④ The mysql_fetch_array() function returns the first row from the recordset in the form of an array

⑤ Note that the mysql_fetch_array() function should be placed directly in while, otherwise it will loop infinitely

        //search result
        // The mysqli_query() function executes a MySQL query
    	$result = mysqli_query($connect,"select* from user");
    	//The number of rows in the result set, which is obtained from the call to 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>";

 

 

 

 

 

 

.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326171528&siteId=291194637