I am new to both PHP and MySQL (I have experience in ASP) and am trying
to get my server running both. I can connect to the MySQL server under
DOS using the command line and can create new databases this way. I want
to create a web data site so I need to accomplish this via HTML. I have
tried to follow the instruction in various books without success. Can
anyone help with advice?
Below is the simple code I am using that the book tells me should work
but it doesn't.
<HTML>
<HEAD>
<TITLE>Creating a Database</TITLE>
</HEAD>
<BODY>
<?php
// Set the variables for the database access:
$Host = "localhost";
$User = "root";
//$Password = ""; (no password set at this stage)
$DBName = "testbase2";
$Link = mysql_connect ($Host, $User);
if (mysql_create_db ($DName, $Link)) {
print ("The database, $DBName, was successfully
created!<BR>\n");
} else {
print ("The database, $DBName, could not be created!<BR>\n");
}
mysql_close ($Link);
?>
</BODY>
</HTML>
TIA
Mike
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php