function checkNo($tbl,$no,$sn=""){ global $xoopsDB; $andKey = $sn ? " and `sn` != '{$sn}'" : ""; //編輯 $sql = "select `sn` from " . $xoopsDB->prefix($tbl) . " where `no`='{$no}'{$andKey} "; //die($sql); //ajaxDebug($sql,"checkNO"); $result = $xoopsDB->query($sql); $row = $xoopsDB->fetchArray($result); if($row['sn']){ return true; } return false; }