>  기사  >  php教程  >  学习笔记PHP(1)之mysql操作

学习笔记PHP(1)之mysql操作

WBOY
WBOY원래의
2016-06-06 19:40:52756검색

1、auto_increment 就是对主键 id 自动增加编号的 2、describe查看table的详细信息,先要进入数据库,使用use PrTarget 3、删除表,使用drop table 表名,例如删除Users表,drop table Users 4、使用重定向文件 操作 ,例如 mysql -h localhost -u test -D P

1、auto_increment 就是对主键 id 自动增加编号的

2、describe查看table的详细信息,先要进入数据库,使用use PrTarget

3、删除表,使用drop table ,例如删除Users表,drop table Users

4、使用重定向文件操作,例如

mysql -h localhost -u test -D PrTarget -p

5、插入语句 insert into [table(column1, column2, ...)] values(value1, value2, …)

例如: insert into Users(userId, userName) values(3, “lc”)

6、双重排序

例如:按照用户名降序排序,如果一样使用userId升序排序.

 select * from Users order by userName desc, userId sac;

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.