Create new table in MySQL : Table Create « MySQL Database « PHP






Create new table in MySQL

<?php
$linkID = mysql_connect('mysql153.secureserver.net', 'java2s', 'password');
mysql_create_db('new_db', $linkID);
mysql_select_db('new_db');

$query = "CREATE TABLE new_table (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, new_col VARCHAR(25))";
$result = mysql_query($query);
$axe = mysql_drop_db('new_db');
?>

           
       








Related examples in the same category

1.Table-Creation Script
2.Creating a Table in MySQL
3.Create table and install data