MySQL 隨機密碼生成代碼建站知識
導(dǎo)讀:1建站知識晚上有朋友問起,簡單的寫了一個。 DELIMITER $$ CREATE FUNCTION `t_girl` . `func_rand_string` ( f_網(wǎng)站建設(shè)公司網(wǎng)站優(yōu)化seo培訓(xùn)。
晚上有朋友問起,簡單的寫了一個。
DELIMITER $$
CREATE
FUNCTION `t_girl` . `func_rand_string` ( f_num tinyint unsigned , f_type tinyint unsigned 網(wǎng)站seo優(yōu)化課程)
RETURNS varchar ( 32)
BEGIN
-- Translate the number to letter.
-建設(shè)網(wǎng)站- No 1 stands for string only.
-- No 2 stands for number only.
-- No 3 stands for combination of the above.
declare i int unsigned default 0;
declare v_result varchar ( 255) default '' ;
while i < f_num do
if f_type = 1 then
set v_result = concat ( v_result, char ( 97+ ceil( rand ( ) * 25) ) ) ;
elseif f_type= 2 then
set v_result = concat ( v_result, char ( 48+ ceil( rand ( ) * 9) ) ) ;
elseif f_type= 3 then
set v_result = concat ( v_result,網(wǎng)站seo優(yōu)化診斷工具 substring ( replace ( uuid ( ) , '-' , '' ) , i+ 1, 1) ) ;
end if;
set i = i + 1;
end while;
return v_result;
END $ $
DELIMITER ;
調(diào)用方法示例:
select func_rand_string(12,3);
相關(guān)網(wǎng)站建設(shè)公司網(wǎng)站優(yōu)化seo培訓(xùn)。
聲明: 本文由我的SEOUC技術(shù)文章主頁發(fā)布于:2023-05-24 ,文章MySQL 隨機密碼生成代碼建站知識主要講述密碼,標(biāo)簽,SQL網(wǎng)站建設(shè)源碼以及服務(wù)器配置搭建相關(guān)技術(shù)文章。轉(zhuǎn)載請保留鏈接: http://www.bifwcx.com/article/web_6732.html
為你推薦與MySQL 隨機密碼生成代碼建站知識相關(guān)的文章
-
通王TWCMS 2.0.3網(wǎng)站模板程序下載
(126)人喜歡 2024-01-15 -
Windows官方原版在哪里下載
(175)人喜歡 2024-01-15 -
WordPress網(wǎng)站模板發(fā)帖標(biāo)題顏色設(shè)置
(131)人喜歡 2024-01-07 -
修改discuz論壇帖子標(biāo)題80字符的長度限制
(249)人喜歡 2024-01-07 -
wordpress程序調(diào)用不帶超鏈接的Tag標(biāo)簽
(234)人喜歡 2024-01-05 -
網(wǎng)站在不同時期需調(diào)整內(nèi)容更新的方向
(112)人喜歡 2023-08-12