Welcome to my A10 simple_database_retrieval

Below is the result:

connect_errno > 0) { die('Unable to connect to database [' . $conn->connect_error . ']'); } //Use SQL to select table... $sql = "SELECT * FROM user";//"user" is a table name inside "practice_chastezl" database. if(!$result = $conn->query($sql)) { die('There was an error running the query [' . $conn->error . ']'); } //How to get and display each row. while($row = $result->fetch_assoc()) { echo '

'; echo "ID: ".$row['id']." First Name: ".$row['firstname']." Last Name: ".$row['lastname']." Email: ".$row['email'] ;//Use field names. echo '

'; } echo "This is my first PHP with Database."; $result->free();//Clear $conn->close($conn);//disconnect. ?>

Click Here to goback previous HTML file.