I know I can’t connect from a remote source with a free account, but I’ve set up the connection string to use the information provided by the database information on my account page. Even on phpMyAdmin, the server is listed as the same, but the live website doesn’t recognize the hostname.
Cannot redeclare addNewUser() (previously declared in /home/vol1000_8/infinityfree.com/if0_40342379/htdocs/dbConnect.php:15) in
/home/vol1000_8/infinityfree.com/if0_40342379/htdocs/dbConnect.php
on line
15
Normally yes, but the only change I’ve made from functional local code is the PDO creation parameters, so unless proven otherwise I’m going to assume it’s a consequence of the fact that the PDO reference doesn’t exist.
Try to remove the :3306 part after the hostname on the host parameter of the DSN and see if it works. Also, make sure there is no extra space before or after the hostname (or new line in your case).
2 potential issues
1 - it might be a formatting issue here, but there shouldn’t be a space between the host and port.
2 - Having checked my own code where I’ve done the same, I didn’t include the port. So maybe try removing it
–edit–
Jxst’s post appeard just as I hit send haha
Hello. I’m actually seeing HTTP 500 error. Is PHP error reporting enabled? There could be a syntax or error in your PHP code. The 404 error is just about favicon.ico.