$cn = mysql教程_connect('localhost','root','');
mysql_select_db('test',$cn);
//創建數據庫
mysql_query("create datebase 'test';");
//創建數據表
$sql ="CREATE TABLE IF NOT EXISTS `test` (
`id` int(8) NOT NULL auto_increment,
`title` char(150) default NULL,
`content` text,
`addNewColumn` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;";
if( mysql_query( $sql ) )
{
echo '111cn.net提示你創建數據表test成功';
}
else
{
echo '111cn.net提示你:查檢sql語句,數據表創建失敗';
}
//本文章原創於www.111cn.net轉載注明出處