This is my first time mixing PHP and SQL, and my problem is that I cannot connect to my database with PHP.
I am using mysql_connect
(and I've also found mysqli_connect
, I can't see the difference).
This is my code:
mysql_connect("localhost", "username", "password","db_name");
I have put it between < ?php
and a ?>
in my index.php file.
And all it has showed me so far is this:
Parse error: syntax error, unexpected 'mysql_connect' (T_STRING) in /home/username/domains/website.com/public_html/index.php on line 63
I can't see the problem since I've been doing everything according to W3C's tutorial.