我需要從一個mysql表中計算出平均值。所以我正在把col的總和除以行數。但價值沒有被正確分配: - $total_sum_query = $db->query("SELECT SUM(marks) FROM markstable WHERE sid = '$sid'");
$num_rows_query = $db->query("SELECT * FROM markstable WHERE
如何將其作爲PDO查詢運行? $query = "SELECT * FROM `Top_10` WHERE DOB =". $date;
$result = mysql_query($query) or die(mysql_error());
if(mysql_num_rows($result)==0){
while blah blah
}
我可以運行PDO讀取數組。但只要我這樣做,它