$arr = array('1','2','3','4','5');while ($get = $arr[rand(0,count($arr)-1)]; !(mysql_fetch_array(mysql_query("select * from $sqltable where haoma=$get"))))
{
mysql_query("update $sqltable SET haoma=$get where user_name='$user_name' and user_pws='$user_pws'");//取得值并分配不重复的号码,在1-5范围里
}}