Background - I am building an contest entry form to win a prize. There will be a web-based admin for my client to pick a winner each day.
This is my first time configuring a site on Bluehost.
What I've done so far
- Created a database in cPanel X
- Created a database user
- Created necessary table(s) in phpMyAdmin
When I test my form mysql_error() returns 'No database selected' after you submit the form.
I am assuming I'm not connecting to the db correctly or am missing something. Right before my INSERT statement I have this code:
Code in question
mysql_connect("localhost", "userprefix_username", "password");
FYI - I echo'd my sql INSERT statement and tested it in phpMyAdmin and it works.
I know this question has been asked similarly before but I couldn't get a solution from those threads. Any help appreciated.