Mysql - "No database selected"?

bobrocket9942

New Member
Messages
14
Reaction score
0
Points
0
Hi guys!
I was making a gaming community website, and when I was pulling a mysql connect for an activation code, I get an error saying "No database found" (It's a mysql_error() thing..)

The code:
<?php


$server = "localhost";
$dbuser = "bobrocke_1";
$dbpass = "*********";
$database = "bobrocke_users";


mysql_connect($server, $dbuser, $dbpass);
mysql_select_db($database);


?>

The database is "bobrocke_users" and the table is "users" if that helps..
Thanks!
 

John Rambo

New Member
Messages
27
Reaction score
0
Points
1
Does database exist and spelt correctly? You can check it by sql SHOW DATABASES query.
 

bobrocket9942

New Member
Messages
14
Reaction score
0
Points
0
Does database exist and spelt correctly? You can check it by sql SHOW DATABASES query.
It's spelt correctly.
Checked the databases;
"bobrocke_users" which is exactly what I have in the code.

---------- Post added at 05:40 PM ---------- Previous post was at 04:01 PM ----------

Fixed it!
I hadn't put the user into the database. xD Rookie error, right? :)
 
Top