Answers for "how to check if php is connected to database"

PHP
0

how to check if php is connected to database

<?php
$con = new mysqli("host","username","password","database");
echo $con ? 'connected' : 'not connected';
?>
Posted by: Guest on September-27-2021

Code answers related to "how to check if php is connected to database"

Browse Popular Code Answers by Language