+ 3
help me connect database
hello sololearner this is my first time i'm trying to connect database with my php page. i tried however i failed i'm not using wamp or xamp i'm using hosting so please check wheter 1. SERVER NAME IS WRONG 2. OR OTHER MISTAKE I DID 3. GIVEN BELOW IS MY CODE <?php $servername = "sql205.epizy.com"; $username = ""; $password = ""; $dbname="epiz_24380269_data_base"; // Create connection $conn = mysqli_connect($servername, $username, $password,$dbname); // Check connection if ($conn) { echo"true"; } echo "false"; ?> IF MY SERVER NAME IS WRONG PLEASE TELL ME HOW CAN I FIND RIGHT SERVER NAME
7 Answers
+ 4
THE HOST PROVIDE YOU WITH THE SERVERNAME, USERNAME, AND PASSWORD.
CHECK ON YOUR DATABASE IN CPANEL
also, dont post those information in public, its easy for people to mess up your database if we know how to get in.
+ 3
Please remove other words from Relevant Tags except for SQL PHP and MySQL đ
(Edit)
Tags edited by moderator. Thanks @Tashi N đđ
+ 2
btw you can print the error message if its failed
either mysqli_connect_error()Â for connection error or mysqli_error(). its much easier to find the exact error
+ 1
Taste thanks for the answer i know this server etc should be confidential thats why i create this free hosting only for practice brođ
+ 1
Terdoo - Toheeb Osu its ok bro now problem has been sort out đđ
+ 1
Use object oriented
0
I would love to help you but my programming database language is SQL