mysql 返回查詢數量,如何接收函數返回值?mysql中要獲得存儲過程的返回值,可以增加一個out參數,用來返回。mysql中存儲過程的例子:CREATE PROCEDURE addvoucher (IN userid INT,IN voucherid INT,OUT result INT)BEGINSELECT@endate_a := endate ,@batch_a := batch ,@c_count_a := c_count,@isdead_a := isdeadFROMt_voucherWHEREid = voucherid;SET autocommit = 0;IF EXISTS (SELECT*FROMt_user_voucher tuv,t_voucher tvWHEREtv.id = tuv.voucheridAND tv.batch =@batch_a) THENSET result = 1;-- 已存在SELECTresult;ELSEIF @c_count_a > 0 THENIF (TO_DAYS(@endate_a) - TO_DAYS(NOW())) > 0 THEN
網站導航
- zblogPHP模板zbpkf
- zblog免費模板zblogfree
- zblog模板學習zblogxuexi
- zblogPHP仿站zbpfang