From 859318f5719f3f6bd03779d818bc24484f63f7ac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BB=98=E7=A8=8B=E7=95=85?= <2029006014@qq.com>
Date: Tue, 24 May 2022 12:36:57 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BD=9C=E4=B8=9A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../20220523\344\275\234\344\270\232.md" | 61 +++++++++++++++++++
1 file changed, 61 insertions(+)
create mode 100644 "\344\273\230\347\250\213\347\225\205/20220523\344\275\234\344\270\232.md"
diff --git "a/\344\273\230\347\250\213\347\225\205/20220523\344\275\234\344\270\232.md" "b/\344\273\230\347\250\213\347\225\205/20220523\344\275\234\344\270\232.md"
new file mode 100644
index 0000000..bced6cb
--- /dev/null
+++ "b/\344\273\230\347\250\213\347\225\205/20220523\344\275\234\344\270\232.md"
@@ -0,0 +1,61 @@
+```php
+CREATE DATABASE student CHARSET utf8;
+use student;
+CREATE TABLE user(
+id int NOT NULL primary key auto_increment,
+name VARCHAR(20) NOT NULL,
+score DECIMAL(10,2) NOT NULL
+);
+INSERT INTO user(name,score) VALUES ('陈小龙',98.5);
+INSERT INTO user(name,score) VALUES ('吴大虫',75.5);
+INSERT INTO user(name,score) VALUES ('陈得胜',66);
+";
+}else{
+ echo "添加失败"."
";
+}
+
+$delete="delete from user where id>5";
+$c=mysqli_query($a,$delete);
+$cc=mysqli_affected_rows($a);
+if ($cc==0){
+ echo "没有相应数据,删除失败"."
";
+}else if($cc<0){
+ die("运行错误"."
");
+}else{
+ echo "删除成功"."
";
+}
+
+$update="update user set name='李白' where id=2";
+$d=mysqli_query($a,$update);
+if ($update){
+ echo "修改成功"."
";
+}else{
+ echo "修改失败"."
";
+}
+
+$select="select * from user";
+$d=mysqli_query($a,$select);
+
+$e=mysqli_fetch_all($d);
+foreach ($e as $aini){
+ foreach ($aini as $taoyanni){
+ echo $taoyanni." ";
+ }
+ echo "
";
+}
+
+while ($f=mysqli_fetch_assoc($d)){
+ echo $f['id']."=".$f['name']."=".$f['score']."
";
+}
+```
\ No newline at end of file
--
Gitee