•
•
•
•
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
![]() |
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
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.
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.
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());
•
•
Join Date: Mar 2008
Posts: 153
Reputation:
Rep Power: 1
Solved Threads: 19
The table already exists. Your latest code is correct (the other you had "$database_name" in quotes, which is incorrect).
Matti Ressler
Suomedia
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
Suomedia - Dynamic Content Management
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.
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.
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.
![]() |
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Repair Access database (VB.NET)
- Python-mysql for checking table exist or not (Python)
- Table = 100% in IE but not in FireFox? (HTML and CSS)
- Where is the table ???? (ASP.NET)
- C++hash table lookin' 4 help~~ (C++)
- Exclusionary SELECT in SQL (MySQL)
- radio button ASP question?? (ASP)
- How to stop Php is something does not exist (PHP)
Other Threads in the MySQL Forum
- Previous Thread: Recommended books?
- Next Thread: Database Problem.........


Linear Mode