No database selected

SineC

New Member
Messages
1
Reaction score
0
Points
0
My php connection code

// Parametres persos connexion
$host = "localhost"; // voir hŽbergeur
$user = "sinec"; // vide ou "root" en local
$pass = "*****"; // vide en local
$user1 = "sinec_sinec"; // vide ou "root" en local
$pass1 = "****"; // vide en local
$bdd = "sinec_sitemovies"; // nom de la BD

//Verif ci en Local ou Internet
if($SERVER_NAME == "10.0.0.3"){ $mysql_link = mysql_connect($host,$user,$pass);}
else{ $mysql_link = mysql_connect($host,$user1,$pass1);}

//Connection a la Base Donn
mysql_select_db($bdd,$mysql_link) or print("Can't Connect 2 DB");

But at the end i get "[FONT=Arial, Helvetica, sans-serif]ERROR 1046 : No database selected"
What is going rong works great at home but i don't have my name in front og the db name

Tryed to change the name but nothing
[/FONT]

Edit:
Well got it working :)
The thing i did was creat the base useing MySQL Database (not wizard) created my base and user, acoissiated them together and tryed using it :)
But nothing always a nice error 1046, so tryed losts of stuff changing names of all user and pass and db but nothing.
And then returned to the cPanel and tryed using the wizard with out dumping what i created using the other method, used the same name for all.
And voila its working not shure why but it workssss
THXX
 
Last edited:
Top