Title1

Title2

Title3

2-2-2 檢查編號是否重覆


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