创建表:
create table 表名 (
字段1名 varchar(255) not null default '',
字段2名 varchar(255) not null default ''
);
查看表结构:
desc 表名;
show columns from 表名;
describe 表名;
insert:
insert into 表名(字段1名,字段2名) values('值1','值2');
或
insert into links values('值1','值2'); #必须按字段顺序
update:
update 表名 set 字段=’值’ where 字段=” 值”;
delete:
delete from 表名 where 字段=”值”;
清空表:
delete from 表名; #不会重置ID的自增
truncate 表名; #相当于保留mysql表的结构,重新创建了这个表,所有的状态都相当于新表。