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;
?>