创建表
create table <表名>( <字段名> 类型(长度) not null primary key auto_increment, **主键 name char(20) not null, sex int(4) not null default '0', **默认键 degree double(16,2) )
删除表
drop table <表名>; //情空表 delete from <表名>;
插入数据
insert into <表名> [( <字段名1>[,..<字段名n > ])] values ( 值1 )[, ( 值n )]
查询表
select <字段1,字段2,...> from < 表名 > where < 表达式 >
查询表的前几个字段
select * from MyClass order by id limit 0,2;
查询字段总和
select sum('字段名') from 表名
查询字段 按照升序降序排列
降序:select * from 表名 where 表达式 order by 字段名 desc
升序:select * from 表名 where Putout=true order by time asc
SmartB2B 是一款基于PHP、MySQL、Smarty的B2B行业电子商务网站管理系统,系统提供了供求模型、企业模型、产品模型、人才招聘模型、资讯模型等模块,适用于想在行业里取得领先地位的企业快速假设B2B网站,可以运行于Linux与Windows等多重服务器环境,安装方便,使用灵活。 系统使用当前流行的PHP语言开发,以MySQL为数据库,采用B/S架构,MVC模式开发。融入了模型化、模板
删除表
delete from 表名 where 表达式
修改表
update 表名 set 字段=新值,… where 条件
添加表字段
alter table 表名 add 字段 类型 其他;
删除表字段
alter table 表名 drop 字段名









