<?php
//未读消息统计函数
function NoReadMess($MyID,$type){
$sql = "SELECT * FROM ask_list WHERE type ='{$type}' AND  read='0' AND sendinfo LINK '%:{$MyID}' "; 
$lists = mysql_query($sql);
if($lists && mysql_num_rows($lists)>0){
	return mysql_num_rows($lists);
	}else{
	return 0;
		}
	}
//统计来自某个人的未读消息
function NoReadMessWho($MyID,$Who,$type){
$sql = "SELECT * FROM ask_list WHERE type ='{$type}' AND read='0' AND sendinfo='{$Who}:{$MyID}'"; 
$lists = mysql_query($sql);
if($lists && mysql_num_rows($lists)>0){
	return mysql_num_rows($lists);
	}else{
	return 0;
		}
	}
?>