-1
我目前正在寫一個PHP腳本,但是我在使用過時的功能的問題..不推薦使用:功能mysql_numrows()被棄用
可能有人請解釋我是如何從被棄用停止這些功能或如何改變他們到當前的:
function calcNumActiveGuests(){
/* Calculate number of guests at site */
$q = "SELECT * FROM ".TBL_ACTIVE_GUESTS;
$result = mysql_query($q, $this->connection);
**$this->num_active_guests = mysql_numrows($result);**
}
function calcNumActiveUsers(){
/* Calculate number of users at site */
$q = "SELECT * FROM ".TBL_ACTIVE_USERS;
$result = mysql_query($q, $this->connection);
**$this->num_active_users = mysql_numrows($result);**
}
他們現在給我的錯誤Deprecated: Function mysql_numrows() is deprecated
可能重複的[MySQL的\ _num \ _rows replacment到建議更換?](http://stackoverflow.com/questions/20396858/mysql-num-rows-replacment-to-recomend) – moonwave99
我讀過那篇文章,但對我來說它沒有意義的答案,所以我創建了這個與我的代碼 – AppStash
到s從棄用的功能開始,您將需要一臺時間機器。 – Rasclatt