Database Not found after server move!?

corsoconnected

New Member
Messages
6
Reaction score
0
Points
0
This was working fine before the move and migration. It connects to the server even if i use 'localhost' it still connects however my PHP page the refers to this connection comes back with the die error "No database selected.". On the actual scripting where 'My Data base Name Here' it actually contains the data base name. Any ideas why its no longer working!?
***************************************************************
<?php

$db = mysql_connect("mysql-boru.x10hosting.com", "******", "****") or die("Could not connect.");

if(!$db)

die("no db");


if(!mysql_select_db("My Data Base Name Here",$db))

die("No database selected.");

if(!get_magic_quotes_gpc())

{

$_GET = array_map('mysql_real_escape_string', $_GET);

$_POST = array_map('mysql_real_escape_string', $_POST);

$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);

}

else

{

$_GET = array_map('stripslashes', $_GET);

$_POST = array_map('stripslashes', $_POST);

$_COOKIE = array_map('stripslashes', $_COOKIE);

$_GET = array_map('mysql_real_escape_string', $_GET);

$_POST = array_map('mysql_real_escape_string', $_POST);

$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);

}



?>
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
The dbhost is 'localhost'

If that does not work, leave it as 'localhost'

Go to cPanel --> mySQL Databases
Find the database+dbuser list.
Click on the user for that database. On the pop-up, check "ALL PRIVILEGES" and save changes.
 
Last edited:

corsoconnected

New Member
Messages
6
Reaction score
0
Points
0
tried as 'localhost' and as host name set in the example all privileges are enabled still no difference. it connects but on my php that references that connection.php says no database found. i tried defining the user base name as another variable it worked but nothing in my php worked came up with every die error that i stated.
 

vishal

-::-X10 Guru-::-
Community Support
Messages
5,255
Reaction score
192
Points
63
What is URL that is giving you the error ?
 

corsoconnected

New Member
Messages
6
Reaction score
0
Points
0
thanks guys i don't know if going into and resetting all privileges again or what but it seems to be working now. Thanks again, didn't work last week when i tried that lol.
 
Top