I'm having a little trouble selecting a database with php. Here's my problem:
I was working on a Windows machine that was all set up and everything worked well. I had to move over to my Linux box and started httpd and mysql. Everything seems good.
I can access mysql from the command line and everything works wonderfully. But when I try to access it from php via localhost, I can't select a database.
My code that worked on Windows is:
mysql_connect("localhost") or die("Could not connect to MySQL");
mysql_select_db("mydb") or die("Could not connect to database");
My output is "Could not connect to database" which means that I'm connecting fine but not finding or accessing the selected db.
The only thing I can think of is a permissions issue with Linux. I've been Googling this problem for a while with no possitive results, this is my last resort.
I'm not sure the best place to post this question 'cause it could be many problems (php, mysql, linux) but this is the forum I'm most familiar with. If anyone can help me out - or suggest a better place to look for help - I'd appreciate it.
Thanx.