NameSilo

Need help!

Spaceship Spaceship
Watch

tez30

Established Member
Impact
1
i'm having problems with my add-on domain database, when i test my site registration i get this error
Error in checking :No database selected
i created a database for the site.
can anybody help please!
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
My car has broken down it's got 4 wheels, what's wrong with it?

Without the exact error and a look at the code it will be very hard to tell you.

however database selected suggests that in the code you have not included a line to inform the database engine which database you wish to use.
 
0
•••
this is the connect.php code ---
PHP:
<?php
	@session_start();
	//to connect to server
		$dbhost = 'localhost';
		$dbname = 'football';
$dbuser = 'jim';
$dbpass = '12345';

	$dbh=mysql_connect ("localhost", "football", "12345") or die ('I cannot connect to the database because: ' . mysql_error());
		    	
		//to connect to local system
	$dbname = 'football';
	
	mysql_select_db ("football");
	//mysql_connect('localhost','','') or die("Error in connecting database :".mysql_error());
	//mysql_select_db('playstation2tournament') or die("Error in selecting db :".mysql_error());
	
?>


here is the code that's in the index.php the registration page ---
PHP:
 //changing to playstation2tournament database
		$link = mysql_connect('localhost','jim','12345');
		$dbname = 'football';
		mysql_select_db('football');
 
Last edited:
0
•••
in 1 script you are using football as the username and in the other you are using jim which is it?

also why have you bothered to set the database name, host, username and password as variables when you are not using them?
 
0
•••
ok this is the code i have know ---
PHP:
<?php
	@session_start();
	//to connect to server
		
	$dbh=mysql_connect ("localhost", "jim", "12345") or die ('I cannot connect to the database because: ' . mysql_error());
		    	
		//to connect to local system
		
	mysql_select_db ("football");
	//mysql_connect('localhost','','') or die("Error in connecting database :".mysql_error());
	//mysql_select_db('football') or die("Error in selecting db :".mysql_error());
	
?>

can you tell me what's wrong?
 
0
•••
Did you
1. Create the Database
2. Create the user
3. Give user permissions to the databse
4. Using the right username/pw/ip

What is the exact error you are getting?
 
0
•••
Change :-

PHP:
mysql_select_db ("football");

too

PHP:
mysql_select_db ("football") or die ('There is a problem with the selected database: ' . mysql_error());

Hopefully this will then display an error that we can work with. It is quite possible that you have not linked the database user to the database. If you change the code above it should tell us the proper error.
 
0
•••
ok this is the error i'm gettin

>>> Error in checking :Table 'gamersho_playstation2tournament.users' doesn't exist <<<
 
0
•••
that is somewhat strange the error should say football.users' doesn't exist its using the wrong database for some reason.

However the error message is saying that a table called users doesnt exists in the database gamersho_playstation2tournament
 
0
•••
that's the actual site >> playstation2tournament << it's an add-on domain
 
0
•••
yes but it is reporting it to be the name of the database when it should not be.
 
0
•••
i'm workin on it bye my self doing everything from designing to content to learning how program, i need a programing partner. we'll splite all profits 50/50. if you wanna do that.
 
0
•••

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back