Posts

How to Fix Overcoming Failed in 000webhost database connection

Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated

Alright on this occasion today I will share a moment that I used to feel when connecting a database from 000webhost. I tried various ways to overcome this and yes no one can answer then I found an oddity in my website database. What is that ? let's discuss.

1. Why problems occur there are 2 things that can happen. The first is located in your connection.php script and the second is located in the settings when you create the database.

2. The first way you can do is try to open your php connection and replace it with the script below.
<?php
$servername = "localhost";
$database = "namadatabase";
$username = "user";
$password = "passworddatabase";


// untuk tulisan bercetak tebal silakan sesuaikan dengan detail database Anda// membuat koneksi$conn = mysqli_connect($servername, $username, $password, $database); // mengecek koneksiif (!$conn) {
die("Koneksi gagal: " . mysqli_connect_error()); } echo "Koneksi berhasil"; mysqli_close($conn); ?>
3. If it is successful it means there is no problem in your database but if you are not successful it means there is a possibility of something wrong in your database, why? Take a look when you create a database from 000webhost. Are the users and database names you entered the same?

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.