能否請你告訴我怎麼把這個查詢表中..我把這個表中如何
<?
$username="root";
$password="kermit";
$database="moodle";
mysql_connect(localhost,$username,$password);
mysql_select_db($database) or die("Unable to select database");
$query = "SELECT user.firstname, user.lastname, stats.userid, stats.roleid, SUM( statsreads) AS numreads, SUM(statswrites) AS numwrites, SUM(statsreads) + SUM(statswrites) AS totalactivity FROM `mdl_stats_user_daily` stats, `mdl_user` user WHERE userid IN (SELECT userid FROM mdl_role_assignments WHERE roleid IN (1,2,3,4)) AND user.id = stats.userid AND stats.timeend > ".(time() - 604800)." GROUP BY userid ORDER BY totalactivity DESC";
result=mysql_query($query);
$num_rows = mysql_num_rows($result);
mysql_close();
謝謝:)
我在這裏的意思是如何將生成的結果放在我的HTML表格中...... –