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
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