美文网首页Pentest
PHP之MySQL简单操作

PHP之MySQL简单操作

作者: cws | 来源:发表于2016-07-12 23:18 被阅读18次

    连接数据库

    con_mysql.png

    查看数据库

    show_databases.png

    创建数据库

    一般将sql语句保存在文本中,然后复制运行

    create database test;
    use test;
    
    create table users(
    id int not null auto_increment primary key,
    username varchar(20) not null,
    password varchar(32) not null
    );
    
    create table msg(
    id int not null auto_increment primary key,
    uid int not null,
    title varchar(30) not null,
    content varchar(1024) not null,
    ip varchar(15) not null,
    date int(15) not null
    );
    
    create_database_table.png

    插入数据

    mysql_insert.png

    查看数据

    mysql_select.png

    删除数据

    mysql_delete.png

    更新数据

    mysql_update.png

    更改数据库结构

    mysql_alter.png mysql_drop.png

    相关文章

      网友评论

        本文标题:PHP之MySQL简单操作

        本文链接:https://www.haomeiwen.com/subject/szssjttx.html