自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

MySQL數(shù)據(jù)庫返回影響行數(shù)的實際操作流程

數(shù)據(jù)庫 MySQL
此文章主要是向大家講述的是MySQL數(shù)據(jù)庫返回影響行數(shù)的實際操作流程與其實際操作代碼的描述,以下就是文章的主要內(nèi)容描述。

以下的文章主要是向大家描述的是MySQL數(shù)據(jù)庫返回影響行數(shù)的實際操作流程,我們主要是以介紹MySQL數(shù)據(jù)庫返回影響行數(shù)的時機(jī)應(yīng)用代碼來引出其具體的操作步驟,下面就是文章的主要內(nèi)容描述。

  1. found_rows() : select  
  2. row_count() : update delete insert 

注:需要配合相應(yīng)的操作一起使用,否則返回的值只是1和-1(都是不正確的值)

示例:

  1. drop database if exists `mytest`;
    create database `mytest`;use `mytest`;
    drop table if exists `MyTestTable`;
    create table `MyTestTable`(`ID` int ,`Name` varchar(10)); 
    insert into `MyTestTable`(`ID`,`Name`) select '1','role1' 
    union all select '2','role2' union all select '3','role3';select row_count(); 

輸出3(返回新添加的記錄數(shù)),[注:如果使用insert into...values只返回1]

  1. select * from `MyTestTable`;select found_rows();  

 輸出3(返回選擇的行數(shù))

  1. update `MyTestTable` set `Name`='people';select row_count(); 

輸出3(返回修改的行數(shù))

  1. delete from `MyTestTable`;select row_count();  

 輸出3(返回刪除的行數(shù)),以上的相關(guān)內(nèi)容就是對MySQL數(shù)據(jù)庫返回影響行數(shù)的代碼介紹,望你能有所收獲。

MySQL數(shù)據(jù)庫返回影響行數(shù)

上述的相關(guān)內(nèi)容就是對MySQL數(shù)據(jù)庫返回影響行數(shù)的代碼的描述,希望會給你帶來一些幫助在此方面。

【編輯推薦】

  1. Ubuntu mysql可以把data防止到內(nèi)存盤中
  2. Ubuntu MySQL設(shè)置同步服務(wù)器
  3. Linux mysql就用fedora的自動安裝
  4. Fedora MySQL完整備份數(shù)據(jù)的恢復(fù)
  5. CentOS配置中apache+php+mysql安裝
責(zé)任編輯:佚名 來源: cnblogs
相關(guān)推薦

2010-05-20 17:56:43

2010-06-12 09:53:19

2010-05-28 13:48:07

MySQL數(shù)據(jù)庫密碼

2010-05-24 18:56:15

2010-06-01 13:58:24

遠(yuǎn)程連接MySQL

2010-06-07 15:47:05

MySQL 數(shù)據(jù)庫命令

2010-05-24 14:02:06

MySQL數(shù)據(jù)庫

2010-05-27 14:55:40

簡單備份MySQL

2010-05-19 15:12:32

導(dǎo)入MySQL

2010-05-17 10:11:11

導(dǎo)入Mysql

2010-05-20 16:35:12

2010-06-01 17:45:57

MySQL數(shù)據(jù)庫

2010-05-13 10:19:54

2010-06-01 10:17:01

重啟MySQL數(shù)據(jù)庫

2010-05-19 16:31:38

MySQL數(shù)據(jù)庫

2010-06-02 09:27:37

連接MySQL

2010-05-24 16:49:52

2010-05-31 17:55:46

MySQL導(dǎo)出 XLS

2010-05-20 10:10:30

MySQL數(shù)據(jù)庫同步

2010-05-31 16:17:56

MySQL數(shù)據(jù)庫性能
點贊
收藏

51CTO技術(shù)棧公眾號