Hi all:
I am trying to create a db from a simple php script:
<?
$new_db = "testDB2";
$connection = mysql_connect("localhost", "username", "password") or die("Could not connect");
$result = mysql_create_db($new_db, $connection) or die("Couldn't create database.");
if ($result) {
$msg = "<p>Database has been successfully created.</p>";
}
?>
<head>
<title> Create a mySQL database from a php page </title>
<meta name="Generator" content="EditPlus">
</head>
<body bgcolor="#FFFFFF">
<? echo "$msg"; ?>
</body>
However it refuses to let me do this, and dies at the $result line.
I have another script which connects fine, and displays a list of existing db's, however I create a table or two at the command line, and I check that they are there my using 'mysqlshow db_name' which shows 2 tables, but the php script now modified to display tables, doesn't. It keeps on showing the db's but no tables??
WTF??!!
Russ (APU Webteam)
I am trying to create a db from a simple php script:
<?
$new_db = "testDB2";
$connection = mysql_connect("localhost", "username", "password") or die("Could not connect");
$result = mysql_create_db($new_db, $connection) or die("Couldn't create database.");
if ($result) {
$msg = "<p>Database has been successfully created.</p>";
}
?>
<head>
<title> Create a mySQL database from a php page </title>
<meta name="Generator" content="EditPlus">
</head>
<body bgcolor="#FFFFFF">
<? echo "$msg"; ?>
</body>
However it refuses to let me do this, and dies at the $result line.
I have another script which connects fine, and displays a list of existing db's, however I create a table or two at the command line, and I check that they are there my using 'mysqlshow db_name' which shows 2 tables, but the php script now modified to display tables, doesn't. It keeps on showing the db's but no tables??
WTF??!!
Russ (APU Webteam)