Pentest

PHP之MySQL简单操作

2016-07-12  本文已影响18人  cws

连接数据库

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
上一篇 下一篇

猜你喜欢

热点阅读