PHP SMARTY 樣板引擎
###############################
# 檢查users=> email 是否重覆
# Email存在 傳回 false
###############################
function checkEmail($email){
global $db;
$valid = true;
$sql= "select uid
from `users`
where `email`='{$email}'
";
$result = $db->query($sql);
if($result){
list($uid) = $result->fetch_row();
if($uid){
$valid = false;
}
}
return $valid;
}