$q = "SELECT user FROM message where id='1'"; //SQL查询语句mysql_query("SET NAMES GB2312");$rs = mysql_query($q, $conn); //获取数据集if(!$rs){die("Valid result!");}$row = mysql_fetch_array($rs); //这样从资源中取结果,是一个数组print_r($row);