Forum Moderators: coopster
When my (extremely simple) script tries to select the database I created, I get a parse error. The line i'm using is just:
mysql_select_db("testdb",$db);
Anyone have any suggestions as to what (probably obvious) error i'm making? It's driving me mad, because I want to play with my database :)
Which means you won't need the second parameter.
try
mysql_select_db("dbname");
"mysql_select_db() sets the current active database on the server that's associated with the specified link identifier. If no link identifier is specified, the last opened link is assumed."
edit: just as jatar_k said, I didnt notice his post.
The parse error was a missing semi-colon in the previous line where I start the connection to the sql server (duh!) which in the cold light of day I noticed and remedied.
However, now I'm stuck with a different error:
No Database Selected
The line I'm using is still mysql_select_db("testdb",$db);
Surely I am selecting the testdb database? I do have more than one database set up, so I don't know if this would be affecting it.
Before I started working on mysql, I was pretty intimidated by the whole database idea. It seems I was right to be ;)
Thanks for any help or advice.
>>A good way to post about error messages is to post the exact error and then the offending line that is referenced by the error.
I did try I promise ;)
The first problem above mainly resulted from the error message referring to line 8 of my script, when the missing semi-colon was actually on line 6 so I didn't check out the preceeding code too carefully.
If you have a minute i'd really appreciate it if you could help me with my next problem. [webmasterworld.com]
I think me learning mysql is gonna be like configuring a personal firewall - very noisy in the beginning, and then goes quiet and just keeps ticking along in the background ;)