User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 427,203 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,195 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 798 | Replies: 7
Reply
Join Date: Feb 2008
Posts: 298
Reputation: kevin wood is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
kevin wood's Avatar
kevin wood kevin wood is offline Offline
Posting Whiz in Training

table does not exist

  #1  
Mar 28th, 2008
If you read an earlier thread i started i was having completely the opposite problem that i am having now. Before it kept telling me that the table already existed and now it tells me the table does not exist.

I have created the table in the db.php page where all the connections and database is set up the code i have used for creating the table looks like this

		mysql_select_db("$database_name", $connection);
		$sql="CREATE TABLE `broad_images` (
			`ID` int NOT NULL auto_increment,
			`broad1` varchar(100),
			`broad2` varchar(100)
		)";	


and when i try to get some data out of the table it tells me the table has not been created where is it wrong. the code i have used is no different than before i dont think the computer likes me.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2007
Posts: 114
Reputation: mwasif is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 14
mwasif mwasif is offline Offline
Junior Poster

Re: table does not exist

  #2  
Mar 28th, 2008
Check your database if the table is there by using some GUI or command line.
Reply With Quote  
Join Date: Feb 2008
Posts: 298
Reputation: kevin wood is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
kevin wood's Avatar
kevin wood kevin wood is offline Offline
Posting Whiz in Training

Re: table does not exist

  #3  
Mar 28th, 2008
my code now looks like this and i am back where i started as it is telling me the table already exists.

		mysql_select_db($database_name, $connection);
		$sql="CREATE TABLE `broad_images` (
			
			`broad1` varchar(100),
			`broad2` varchar(100)
		)";	
		mysql_query($sql) or die (mysql_error());
Reply With Quote  
Join Date: Mar 2008
Posts: 153
Reputation: Suomedia is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 19
Suomedia Suomedia is offline Offline
Junior Poster

Re: table does not exist

  #4  
Mar 28th, 2008
The table already exists. Your latest code is correct (the other you had "$database_name" in quotes, which is incorrect).


Matti Ressler
Suomedia
If you want your dreams to come true, the first thing you must do is to wake up....
Suomedia - Dynamic Content Management
Reply With Quote  
Join Date: Feb 2008
Posts: 298
Reputation: kevin wood is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
kevin wood's Avatar
kevin wood kevin wood is offline Offline
Posting Whiz in Training

Re: table does not exist

  #5  
Mar 28th, 2008
i thought the code was correct the " " were in by mistake i was trying it with them in to see if that made a difference which it did not. i am still getting the error table already exists.
Reply With Quote  
Join Date: Dec 2007
Posts: 114
Reputation: mwasif is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 14
mwasif mwasif is offline Offline
Junior Poster

Re: table does not exist

  #6  
Mar 28th, 2008
Are you using the same mysql username with PHP and with GUI to confirm the table existance? May be they have rights issue.
Reply With Quote  
Join Date: Feb 2008
Posts: 298
Reputation: kevin wood is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
kevin wood's Avatar
kevin wood kevin wood is offline Offline
Posting Whiz in Training

Re: table does not exist

  #7  
Mar 28th, 2008
i am a bit unsure of what you mean sorry if i sound a bit thick. the username is the same throught and the connection to the database is a permanent connection. the table am i trying to create is being set up on the same page the initial connection is made with the server so the user name could not be any different if that is what you meant.
Reply With Quote  
Join Date: Feb 2008
Posts: 298
Reputation: kevin wood is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
kevin wood's Avatar
kevin wood kevin wood is offline Offline
Posting Whiz in Training

Re: table does not exist

  #8  
Mar 28th, 2008
i am gone for the weekend now but if anyone knows how to fix this problem please feel free to help i will be looking back here on monday morning.

I have tried changing the name of the table and no matter what the name is changed to it brings back the same result that the table already exists.

could it be a problem with as the table is being created at the same time another page is trying to access the table, or the table is being created when the db.php page is access the first time and when i come to place data into it, it tries to create the table again.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MySQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the MySQL Forum

All times are GMT -4. The time now is 10:47 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC