Home >php教程 >php手册 >在php中创建 数据表代码

在php中创建 数据表代码

WBOY
WBOYOriginal
2016-06-13 10:07:341090browse

在php教程中创建 数据表代码

  $link=mysql教程_connect("localhost","root","3435945")or die("***".mysql_error());
   echo "成功接连到服务器";
  if(mysql_select_db(base2,$link)) echo"选择到base2数据库教程";
 
 
  $sql="create table t1(id int(5) not null primary key,name varchar(12) not null)";
  if(mysql_query($sql,$link))
  echo "表T1创建成功";
  echo "

";
 
  echo "当前base2数据库上的表有:";
  echo "

";
  $table_list=mysql_query("show tables",$link);
  while($row=mysql_fetch_row($table_list)){
     echo $row[0];
     echo "

";

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn