作者yhls (yhls)
看板PHP
标题Re: [问题]关於if...else问题
时间Thu Sep 21 13:54:35 2006
※ 引述《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