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

創(chuàng)新互聯(lián)建站是一家專業(yè)提供巴林右旗企業(yè)網(wǎng)站建設(shè),專注與成都網(wǎng)站制作、成都做網(wǎng)站、外貿(mào)營銷網(wǎng)站建設(shè)、H5高端網(wǎng)站建設(shè)、小程序制作等業(yè)務。10年已為巴林右旗眾多企業(yè)、政府機構(gòu)等服務。創(chuàng)新互聯(lián)專業(yè)網(wǎng)站建設(shè)公司優(yōu)惠進行中。
- found_rows() : select
- row_count() : update delete insert
注:需要配合相應的操作一起使用,否則返回的值只是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]
- select * from `MyTestTable`;select found_rows();
輸出3(返回選擇的行數(shù))
- update `MyTestTable` set `Name`='people';select row_count();
輸出3(返回修改的行數(shù))
- delete from `MyTestTable`;select row_count();
輸出3(返回刪除的行數(shù)),以上的相關(guān)內(nèi)容就是對MySQL數(shù)據(jù)庫返回影響行數(shù)的代碼介紹,望你能有所收獲。
上述的相關(guān)內(nèi)容就是對MySQL數(shù)據(jù)庫返回影響行數(shù)的代碼的描述,希望會給你帶來一些幫助在此方面。
【編輯推薦】
- Ubuntu mysql可以把data防止到內(nèi)存盤中
- Ubuntu MySQL設(shè)置同步服務器
- Linux mysql就用fedora的自動安裝
- Fedora MySQL完整備份數(shù)據(jù)的恢復
- CentOS配置中apache+php+mysql安裝
當前文章:MySQL數(shù)據(jù)庫返回影響行數(shù)的實際操作流程
URL地址:http://www.dlmjj.cn/article/cciospi.html


咨詢
建站咨詢
