湖濱散記部落格的樹心幽徑[login][主頁]
615:20201214自MYSQL資料庫的custs資料表刪除選定的資料錄或修改符合條件的資料錄的欄位值

(一)使用phpMyadmin來操作MySQL資料庫:
(1-1) 用firefox 連上你的本機伺服器/本機首頁上方的phpMyAdmin並用root帳號登入
(1-2)先點選左方「新增」/按SQL/執行如下7個 SQL指令:
CREATE DATABASE selldb default character set utf8;
use selldb;
CREATE TABLE custs (id char(10),name char(20),amount float,tel char(20));
insert into custs(id,name,amount,tel) values ("10001","小狗",100,"233111");
insert into custs(id,name,amount,tel) values ("20002","小貓",200,"233444");
insert into custs(id,name,amount,tel) values ("30003","小牛",300,"233777");
select * from custs;

(1-3)點選左方「selldb」資料庫/按SQL/執行如下 SQL指令來刪除custs資料表符合條件的資料:
delete from custs where id="10001"


(1-4)點選左方「selldb」資料庫/按SQL/執行如下 SQL指令來修改custs資料表符合條件的資料欄位值:
UPDATE custs SET NAME="大狗" WHERE NAME="小狗"


select id,article_id,topic,text from lt_articles_text where article_id =615; ok. update lt_articles set num_reads=num_reads +1 where id=615; ok.