Blogger Information
Blog 19
fans 0
comment 0
visits 11119
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
11月20日_php基础8之数据库增删改查--php培训9期线上班
炭烧鸡腿卤煮米线
Original
496 people have browsed it

创建两个数据表

增删改查代码

添加数据

INSERT INTO `makeup` (

	`buwei`,
	`gongneng`,
	`chanpin`,
	`color`,
	`price`,
	`kucun`,
	`ronglang`,
	`gongxiao`,
	`chandi`
)
VALUES
	(

		'眼部',
		'***',
		'探险家十二色动物眼影',
		'05小熊猫',
		'129',
		'140',
		'14g',
		'眼部修饰',
		'中国'
	)

 

1.1.png

修改数据

UPDATE
	`makeup`
SET `pinpai` = '完美日记'
WHERE
	`id` = 9;

 

1.2.png

选择数据

SELECT `number` FROM `shoes` WHERE `id`>=3 LIMIT 2,2

 

1.3.png

删除数据

DELETE FROM `shoes` 	WHERE `number`='2019Q4-JAB45'


1.4.png

手写:

微信截图_20191122100608.png

总结:

数据表一定得存在主键,另外还需要注意字符类型

语句不可以混淆,不然会出错

在删除语句中,删除行之后id不会自动补齐,仍然是之前设置的id

Correcting teacher:查无此人查无此人

Correction status:qualified

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