怎样用php来创建数据表
1、打开php的编辑器,写上这个程序的注释内容。
2、然后新建一个函数create_table
3、新建需要连接数据库的变量并赋值。
4、然后通过mysqli连接数据库。
5、连接好之后,我们开始写创建数据釉涑杵抑表的sql语句。$sql="create table test1( id int(7) unsigne颊俄岿髭d not null auto_increment primary key, username varchar(64) not null, age int(3) not null, register_time timestamp )";
6、执行sql语句。$connect->query($sql)
7、调用这个函数。create_table();
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:35
阅读量:74
阅读量:64
阅读量:24
阅读量:93