PHP CONNECTION WITH MYSQL | HOW WE MAKE A PHP CONNECTION WITH MYSQL | SHARAFAT HUSSAIN SOFTWARE DEVELOPER

5개월 전

php connection.png

MAKE A PHP CONNECTION WITH MYSQL FOLLOW THESE STEP...

  1. Install xamp latest version
    
  2. Run Apache and mysql services on control panel
    
  3. Open C:\xampp\htdocs\
    
  4. Make Directory in C:\xampp\htdocs\Android
    
  5. Create a new php file on notepad or vs code editor.
    
  6. Create mysql Database in localhost by opening it on any browser
      http://localhost/phpmyadmin/
    
  7. After creat new db in mysql then open your connecton.php file in code editor and past the following code..
    
<?php $servername = "localhost"; $username = "root"; $password = ""; $database = "test";

// Create connection
$conn = mysqli_connect($servername, $username, $password, $database);

// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully";
?>

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
STEEMKR.COM IS SPONSORED BY
ADVERTISEMENT