0

Testing connection to database problem...

Hello dear solo learners.... I'm testing connection to my MySQL database using the codes below: <?php $servername = "localhost"; $username = "root"; $password = ""; $dbname = "registration"; $conn = mysqli_connect($servername, $username, $password,$dbname); // Check connection if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } echo "Connected successfully"; ?> The problem is when i run the codes, neither error is display nor echo.... what might be the tricky behind to make make this work... I have save the codes as connection.php and saved it in hotdocs in the xampp file..

4th Oct 2018, 7:19 AM
Kelvine De Danielo
Kelvine De Danielo - avatar
1 ответ
+ 1
Hello there! may I ask how did you run the code? what URL you used in the browser? if there was any error, normally an error message is shown, especially having the die() executed, as seen in your code (*curious*). Pre-checks: * Web server is running * MySQL is running
4th Oct 2018, 11:09 AM
Ipang