Cannot connect to database (000webhost)

后端 未结 2 1263
攒了一身酷
攒了一身酷 2021-01-23 04:04
$host=\"mysql13.000webhost.com\";      
$username=\"a1346032\"; 
$password=\"\"; 
$db_name=\"a1346032_newdb\"; 
$tbl_name=\"members\"; 

mysqli_connect(\         


        
相关标签:
2条回答
  • 2021-01-23 04:33

    000webhost only lets you access the database through it's own PHP host or it's own PHPMyAdmin.

    You can't access it from your own computer or another server, unless you upgrade your account (by paying).

    0 讨论(0)
  • 2021-01-23 04:35

    Use this at that place

    $host="localhost"; $username="a1346032"; $password="<password>"; $db_name="a1346032_newdb"; $tbl_name="members"; $con=mysqli_connect("$host", "$username", "$password", $db_name)or die("cannot connect"); mysqli_select_db``($con, "$db_name")or die("cannot select DB");

    0 讨论(0)
提交回复
热议问题