just started learning php mysql dont know if i am doing this right
trying to create a database with 4 columns
this is what i have so far
PHP Code:<html>
<head>
<title>
mysql databser
</title>
</head>
<body>
<? php
$new_db = "testDB2";
$connection = mysql_connect("localhost", "craig", "1978");
if (!$connection)
{
die("Could not connect to the server");
}
$result = mysql_create_db($new_db, $connection);
if ($result)
{
$msg = "Congrats! Your database has been created!";
}
else
{
die("Could not create a new database");
}
?>
<p><?php echo $msg; ?></p>
</body>
</html>Code:mysql>creat database testDB2; mysql>use testDB2; mysql>create table table_name ( column_1_name column_1_type column_1_details, column_2_name column_2_type column_2_details, column_3_name column_3_type column_3_details, column_4_name column_4_type column_4_details, ... ); mysql>create table dbmyrestaurant ( Itemid int not null auto_increment primary key, );
can any one help me please
thanks


Reply With Quote
Bookmarks