Skip to main content

Posts

Showing posts with the label connection

Opening a mySQL database connection

SOURCE CODE: <?php $servername="localhost"; $username="root"; $password=""; //Create a connection     $connect=mysqli_connect("$servername","$username","$password"); //Check the connection if (mysqli_connect_error()){    die("Database connection failed:ERROR: ".mysqli_connect_error(); } else{   echo "Database connected successfully!"; ?>