$msgtoid = "david,anna,hebe"
$array = explode(",",$msgtoid)
for($i=0$i<count($array)$i++){
$sql="SELECT mid,userid,uname FROM `member` where userid=".$array[$i].""
$rs=mysql_query($sql)
$array = mysql_fetch_array($rs)
echo $array['uname']
}
$result = mysql_query("SELECT * FROM table")$data = array()
while($rs = mysql_fetch_assoc($result)){
$data[] = $rs
}
print_r($data)//$data就是数组了
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)