Blogger Information
Blog 40
fans 0
comment 0
visits 29506
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
数据库/PDO--2019-06-05
小人物的博客
Original
635 people have browsed it

1. 写出PDO操作数据库的基本步骤

a.连接数据库

b.创建SQL语句模板

c.创建SQL语句对象

D.将变量绑定到SQL语句模板的命名占位符上

E.执行SQL操作

F.销毁PDO,关闭连接

2. 创始一个学生数据库与学生信息表, 练习常用的增删改查语句

a.新增

实例

insert into info (name,xh) values ('peter','19001');

insert into info (name,xh) values ('david','19002');

insert into info (name,xh) values ('marry','19003');

insert into info (name,xh) values ('jack','19004');

运行实例 »

点击 "运行实例" 按钮查看在线实例

b.修改

实例

update info set name = 'mike' where id = 4

运行实例 »

点击 "运行实例" 按钮查看在线实例

c.删除

实例

delete from info where id=6;

运行实例 »

点击 "运行实例" 按钮查看在线实例

d.查询

实例

select * from info

运行实例 »

点击 "运行实例" 按钮查看在线实例


Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post