Welcome to Geeklog, Anonymous Saturday, December 21 2024 @ 10:18 pm EST
Geeklog Forums
error selecting database
ewen
Anonymous
This is what I get on my screen. What does it mean? How do i fix it?
error selecting database
16
16
Quote
xlord
Anonymous
It means that you didnt add your db name in config.php or.. you misspelled it wrong or something
10
17
Quote
ewen
Anonymous
Is there someway, other then running the script, to make sure that the database is working properly?
I believe that I spelt the name correctly (I copied and pasted it from phpMyAdmin) but I will double check it.
Let\'s, for a second, assume that it is spelt correctly. Is there anything else that could casuse this? The database, because it is on a virtual server, has a really funny name, like 123_com_-_dbname, could that be causing the problem?
Thanks for the help.
17
13
Quote
Status: offline
DTrumbower
Forum User
Moderator
Registered: 01/08/03
Posts: 507
Either db name is wrong or the username does not access.
You could try this in a separate file.
IF (!$dbcn){
echo(\"<p>Unable to login</p>\");
exit();
}
$dbcn = @mysql_select_db(\"dbname\");
IF (!$dbcn){
echo(\"<p>Unable to connect to database.</p>\");
exit();
Change the servername, username, userpassword and dbname.
Text Formatted Code
$dbcn = @mysql_connect(\"servernam\", dbuser\", \"userpassword\" );IF (!$dbcn){
echo(\"<p>Unable to login</p>\");
exit();
}
$dbcn = @mysql_select_db(\"dbname\");
IF (!$dbcn){
echo(\"<p>Unable to connect to database.</p>\");
exit();
14
14
Quote
All times are EST. The time is now 10:18 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content