php$sql_str="select toid,fromId,info,max(addDate) as A_date from msg where toid=1 group fromid order by fromId "$con = mysql_connect("localhost","mysql_user","mysql_pwd");if (!$con) { die('Could not connect: ' . mysql_error()); } $rs= mysql_...
php+mysql数据查询语句问题,两张表user,msg【高分求解】
<?php$sql_str="select toid,fromId,info,max(addDate) as A_date from msg where toid=1 group fromid order by fromId "$con = mysql_connect("localhost","mysql_user","mysql_pwd");if (!$con) { die('Could not connect: ' . mysql_error()); } $rs= mysql_query($sql_str,$con);while($row = mysql_fetch_assoc($rs)){ echo $row['toid']."__".$row['fromid']."__".$row['info']."__"$row['A_date']."</br>";} ?>2017-01-05