看板 PHP 關於我們 聯絡資訊
※ 引述《taiwancat (月季)》之銘言: : 假設沒這個帳號的話 : 你sql語法傳回來的會是空result : 後面自然就跑不出來 : 建議你改成這樣 : $sql = "select count(*) from user_info where user_accout = ".... : ... : $number = mysql_fetch_result($result, 0); : 這樣就能抓到這帳號在資料庫有多少筆 : if($number != 0) : die('this account name exists!'); : else : die('this account name is available.') 多謝指教 不過我查了一下似乎沒有mysql_fetch_result這個函式 改成 $number = mysql_num_rows($result);就好了 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.134.173.80