Hello,
I'm struggling greatly connecting my php page to a database (this is my first time). I'm using c-panel and phpMyAdmin on my domain mmiles hosted by Arvixe.
1. First I went to MySql Databases and called it secure_login and the database has the name: mmiles_secure_login
2. Next I created user e*****s with a password of 1234****, then added user e*****s to the database
3. Then I logged into phpMyAdmin and on the left side, clicked mmiles_secure_login and created a table called User
4. On this table, I created several rows that can be seen in the structure for UserID, FirstName, LastName, Email, and Password
I have no idea where the mySql database saves, but I assume php knows where to look???
5. I add this blip of code to my index.php page:
I keep getting "There was an error loading the database!" So I tried changing 'root' to 'e*****s' and '1234****', but that also did not work. I've tried several other methods listed online but cannot even get past getting the php page to recognize a database even exists so usually can't even get past step one of every online resource I can find on the subject. Any ideas?Code:<?php
$connection = mysql_connect("localhost","root","") or die("There was an error loading the database!");
mysql_select_db("mmiles_secure_login", $connection);
?>