Title1

Title2

Title3

6-3-3-2 檢查email是否已經存在


###############################
# 檢查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;
}