Help - Search - Members - Calendar
Full Version: Error: No Database Selected
Zymic Webmaster Forums > Zymic Free Web Hosting > Databases & MySQL
Slunk3R
Hello everyone,

I've got a question, I uploaded my website, but right now it says: NO DATABASE SELECTED.

Here's my database connection:

CODE
<?php
if ($SERVER_NAME == "localhost")
    $db = mysql_connect('localhost','root');
else
    $db = mysql_connect('localhost','skyhighheroes_sh','roj14700');
if (!$db)
{

  echo "No connection possible with the database, please contact the administrator<br>";
    die("Connect Error: " . mysql_error());
}
?>


Can anyone help me with this? I don't know the problem..

Greetings,

Slunk3R
dimon2242
CODE
<?php
if ($SERVER_NAME == "localhost")
    $db = mysql_connect('localhost','root');
else
    $db = mysql_connect('localhost','name-you-site_nameDB','pass');
if (!$db)
{

  echo "No connection possible with the database, please contact the administrator<br>";
    die("Connect Error: " . mysql_error());
}
?>
Slunk3R
That doesn't work.. That doesn't change anything..

Anyone can help?
Ed
You need to select your database:
http://www.php.net/mysql-select-db


Slunk3R
QUOTE(Bread @ May 4 2009, 10:22 AM) *
You need to select your database:
http://www.php.net/mysql-select-db


Thanks, I knew I was missing something, I felt like it.. I just couldn't come up with what it was..

Now I know haha. Problem solved, thanks!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.