Finding database created with php and mysql?

Michael

New member
Hi, I'm trying to learn PHP and mysql.
I made a database using the following php code:
<?php
$con = mysql_connect("localhost", "root", "");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
if (mysql_query("CREATE DATABASE test123",$con))
{
echo "Database created";
}
else
{
echo "Error creating database: " . mysql_error();
}
mysql_close($con);
?>

When I run the code I get the message "Database created"
However if I go to start and search for test123 I get no results.

I am using Server2go

Thanks
Now i'm confused.

Firstly I'm surprised the code is bad, as it is from a website (which seems quite proffesional):
http://www.w3schools.com/PHP/php_mysql_create.asp

Secondly if I try to run the script twice I get
"Error creating database: Can't create database 'test123'; database exists"
So I have the file. Windows search shows nothing, 0 results.

Also if the database is stored within a file, which file is that?

Thanks again
 
Just to let you know, that is a pretty 'bad' code for scripting PHP, and I have no idea what Server2go is.

But the answer to your questions is easy. The database you are looking for is not going to be found by using the windows search function. You have to access it through mysql.

Access mysql through the command line as always, log in, and then use the command 'show databases' (no colon/quotes) and you will see it there. If it does not show up, then you have bad code and it is only saying 'database created' because you told it to.
 
Databases CAN be found but not EASILY identifiable by going to Start->Search because they're not programs!

Databases are only folders stored in a web server (a computer that serves web documents/web pages).

The database tables are actually special files stored inside the database folders, and they're special files that can cram up lots of data to a very small size.

I know this because I'm looking at my database files right now in my own computer (since my computer is hosting my test website). For example, in my "mysql" folder, where my server files and system are located, I can go to the "data" folder and find all the databases I created as folders named after the databases! Inside the database folder, for instance, the "mysql" database folder, I find exactly the database tables as files ending in .FRM, .MYD, and so on.

Once again:
>>Databases are JUST FOLDERS!
>>Database tables are JUST SPECIAL FILES!

So, you can't find databases by going to start menu or do run because they're not programs, but you still can find the databases as folders by doing search (which you may not have noticed).

Hope this helps
 
Databases CAN be found but not EASILY identifiable by going to Start->Search because they're not programs!

Databases are only folders stored in a web server (a computer that serves web documents/web pages).

The database tables are actually special files stored inside the database folders, and they're special files that can cram up lots of data to a very small size.

I know this because I'm looking at my database files right now in my own computer (since my computer is hosting my test website). For example, in my "mysql" folder, where my server files and system are located, I can go to the "data" folder and find all the databases I created as folders named after the databases! Inside the database folder, for instance, the "mysql" database folder, I find exactly the database tables as files ending in .FRM, .MYD, and so on.

Once again:
>>Databases are JUST FOLDERS!
>>Database tables are JUST SPECIAL FILES!

So, you can't find databases by going to start menu or do run because they're not programs, but you still can find the databases as folders by doing search (which you may not have noticed).

Hope this helps
 
Back
Top