Hello! I’m new to InfinityFree and MYSQL, and i was wondering how do i connect databases?
https://infinityfree.net/support/how-to-connect-with-mysql/
(if you can’t read the full post click on the blue link)
I also suggest to use my connection code (created with PHP and the mysqli library):
<?php
define('DBHOST', 'sql123.epizy.com');
define('DBUSER', 'epiz_12345678');
define('DBPASS', '********');
define('DBNAME', 'epiz_12345678_mydb');
$conn = mysqli_connect(DBHOST, DBUSER, DBPASS, DBNAME);
if(!$conn){
echo "Connection failed: ".mysqli_connect_error();
exit;
} else {
return $conn;
}
?>
replacing sql123.epizy.com
with the database host you found on the last steps of the post I linked, epiz_12345678
with your hosting account username, ********
with your hosting account password (if you can’t remember it reset it) and epiz_12345678_mydb
with the database name (formed in the mode username_dbname
) and saving it on a file named “connection.php” or “config.php”.
Where can i find my password i need?
You can find your hosting account password by logging into your Client Area, selecting the hosting account you want to edit / see credentials, scrolling down to “Account Details” and clicking “Show/Hide” to show the password.
I suggest you use this tutorial to make the login/registration system that is also secure, starting from the step 3.
Don’t do step 2! I said to do from step 3, which is titled:
Step 3: Creating the Registration Form
! Also, do step 1. On those codes, after doing that, replace $link
with $conn
.
well. i’ve used this before. Are you sure your table rows are correct? since if not. Something went wrong. it’ll say: Please try again later…
hidden again
to see what’s the error on signup, paste this on line 83 on register.php:
echo "Something went wrong.". $link->error;
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.