兰德函数值 [英] rand function value

查看:60
本文介绍了兰德函数值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建用于生成随机值并与其他值连接的rand函数,并在插入此值之前通过ajax在文本字段中显示.但是在这里如何在将此值插入数据库之前检查该随机生成值是否存在于数据库中.如果该值存在,则再次生成rand函数值并再次将其连接起来.我怎样才能做到这一点?我的代码在

i create rand funtion for generating random value and concatenate with other value and show in the text field through ajax before insert this value. but here how can i check this random generating value is exists or not in database before inserting this value in database.if value is exists then again generate rand function value and again concatenate this. how can i do this? my code is below

<?php $rand=rand(100000,999999);
$roll=$branch_name.$name.$course.$year.$rand;
echo $roll;
?>

推荐答案

我知道我应该解释它的工作原理,但是在Google上确实有很多关于此的信息...

I know that i should explain how its works, but its really a big amount of information about this in google...

在下面的链接中,我附上了网址并附有一些说明:

In a link below i attached the url for it with some explain:

如何在html5中创建单选按钮

这篇关于兰德函数值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆