LoginSignup
0
0

More than 1 year has passed since last update.

MAMPにおけるMySQLiを用いたDB接続(PHP)

Last updated at Posted at 2022-03-27

・MAMPにおけるDB接続
●使うコード
$mysqli = new mysqli("ホスト名", "ユーザー名", "パスワード", "データベース名");
※データベース名は自分で作成したDB名を書く
※PHP公式ドキュメントは以下のページ
https://www.php.net/manual/ja/mysqli.quickstart.connections.php

●MAMP情報(ホスト名、ユーザー名、パスワードの取得)
手順1
1.JPG

手順2
image.png

例)

<?php
$mysqli = new mysqli("localhost:8889", "root", "root", "mydb");
?>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0