PHP and MYSQL create new table
<html>
<head>
<title>PHP and MYSQL create new table </title>
</head>
<body>
<?php
$con = mysql_connect("localhost","root");
if($con)
{
echo "<br> Connected succesfully !!!";
mysql_select_db("my_DB"); //Use existing database for creating new table
if(mysql_query("create table student (rn integer,name varchar(20));",$con))
echo "<BR>New table created successfully";
else
echo mysql_error();
mysql_close($con);
}
else
echo "<br>Connection error .... ".mysql_error();
?>
</body>
</html>
OUTPUT :
<head>
<title>PHP and MYSQL create new table </title>
</head>
<body>
<?php
$con = mysql_connect("localhost","root");
if($con)
{
echo "<br> Connected succesfully !!!";
mysql_select_db("my_DB"); //Use existing database for creating new table
if(mysql_query("create table student (rn integer,name varchar(20));",$con))
echo "<BR>New table created successfully";
else
echo mysql_error();
mysql_close($con);
}
else
echo "<br>Connection error .... ".mysql_error();
?>
</body>
</html>
OUTPUT :
0 comments:
Post a Comment