Experts, please help me see if I write this correctly
-------------------------------- --------
$adminunix = "localhost";
$adminname = "root";
$adminpass = "root";
$admindb = "ckq";
//Connect to the database
$conn =new mysqli($adminunix,$adminname ,$adminpass,$admindb);
//Check the connection
if($conn->connect_error){
die("Connection failed". $conn->connect_error);
}
$sql = "SELECT * FROM lrx ";
$result = $conn-> ;query($sql);
if ($result->num_rows > 0) {
echo $result->num_rows;
while ($row=mysqli_fetch_assoc($result)){
echo '
';var_dump($row);
}
}
$conn->close();
?>
------------- -----------------------
Question 1: How many methods are there in the mysqli class?
Question 2: $ Can row=mysqli_fetch_assoc($result) be written like this?
Question 3: ->What is the difference between num_rows and mysqli_num_rows()
There are many ways to connect to the database, such as object-oriented or process-oriented, and PDO.
These problems can all be solved in practice, and the truth can be obtained through practice