下記のphpを実行すると、「データベース接続失敗」になってしまいます。
【php】
<html> <head><title>php db access test</title></head> <body> <?php $link = mysqli_connect('localhost','user','pwd'); if (!$link) { die('ログイン失敗'.mysqli_error()); } print('<p>ログイン成功</p>'); $db_selected = mysqli_select_db('dbname',$link); if (!$db_selected){ die('データベース接続失敗'.mysqli_error()); } $close_flag = mysqli_close($link); if ($close_flag){ print('<p>切断</p>'); } ?> </body> </html>【環境】
・OS:Centos 7.1
・php:7.2
・mariadb:5.5
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/11/02 03:19