-->

Making connection to mysql using PHP part 1



Welcome back with Sahabat bisnis kalian,
have you ever heard about connecting to database using php? Here we’ll learn about that.


This article containt of how to connect database mysql with PHP. Before that, please make the mysql databse table with xampp.
If you don’t know what is PHP, you should learn it in basic how to make php script for beginner
firstly, let’s make the database. I will give the name “learning_database”

then, write this script to your text editor ( I’am using Notepad++ )

<?php

$servername = "localhost";
$database = "learning_database";
$username = "root";
$password = "";

$konek = mysqli_connect ($servername, $username, $password, $database);

if ($konek!=false){
echo "Connection Success";
} else {
echo "Connection Failed";}
?>

save the program script in directory file : [ C/xampp/htdocs/learning_php ] with the name “connection.php”
why ? just read in basic how to make php script for beginner
then, write this link to your browser 

It shows that your connection is successfully

Finally, we have learning something new again. Don’t forget to read another articles to make you more confident in php program and increase your knowledge.

continue to Making connection Arduino to mysql using PHP part 2

Berlangganan update artikel terbaru via email:

0 Response to "Making connection to mysql using PHP part 1"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel