MySQL 隨機密碼生成代碼建站知識
導讀:1建站知識晚上有朋友問起,簡單的寫了一個。 DELIMITER $$ CREATE FUNCTION `t_girl` . `func_rand_string` ( f_網站建設公司網站優化seo培訓。
晚上有朋友問起,簡單的寫了一個。
DELIMITER $$
CREATE
FUNCTION `t_girl` . `func_rand_string` ( f_num tinyint unsigned , f_type tinyint unsigned 網站seo優化課程)
RETURNS varchar ( 32)
BEGIN
-- Translate the number to letter.
-建設網站- 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,網站seo優化診斷工具 substring ( replace ( uuid ( ) , '-' , '' ) , i+ 1, 1) ) ;
end if;
set i = i + 1;
end while;
return v_result;
END $ $
DELIMITER ;
調用方法示例:
select func_rand_string(12,3);
相關網站建設公司網站優化seo培訓。
聲明: 本文由我的SEOUC技術文章主頁發布于:2023-05-24 ,文章MySQL 隨機密碼生成代碼建站知識主要講述密碼,標簽,SQL網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_6732.html