Hello, this time let's create a page to access the database.
Database connection information is based on the basic information of MAMP.
Set the default connection information for your apm package program.
Basic connection information means user, password.
create folder myProject in htdocs
and then create folder include in myProject
^^ The source is as below.
<?php $host = 'localhost'; $user = 'root'; $passWord = 'root'; //your password $dbName = 'myproject'; $dbConnect = new mysqli($host, $user, $passWord, $dbName); if(mysqli_connect_errno()){ echo "DB Connection Failed." . mysqli_connect_error(); } ?>
atom
result
If you put host, user, password, and db's name in mysqli class, it will be connected to the db ^^.
So let's move on to the next class.
Thank you for visiting. If you have any inquiry or explanation of mistakes, please use the comments below.
//=$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']?>ALL COMMENTS 0
Sort by