Home > php教程 > php手册 > body text

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

WBOY
Release: 2016-06-06 19:40:52
Original
789 people have browsed it

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;

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!