Question: ' ; / / Create connection $conn = new mysqli ( $servername, $username, $password, $dbname ) ; / / Check connection if ( $conn -
;
Create connection
$conn new mysqli$servername, $username, $password, $dbname;
Check connection
if $connconnecterror
dieConnection failed: $connconnecterror;
query database
$result $connqueryselect from contacts";
display the result
if $resultnumrows
output data of each row
while$row $resultfetchassoc
echo "Name: $rowname
"Email: $rowemail
"Phone: $rowphone
;
else
echo results";
echo "Connected successfully";
$connclose; close connection
ulated content in your database table here is the DBContact.php file:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
