我后最近更新的托管的PHP版本我有错误在我的网站,在这里是错误消息弃用功能mysql_db_query错误
Deprecated: Function mysql_db_query() is deprecated in /my_path/file.php on line 13
Deprecated: Function mysql_db_query() is deprecated in /my_path/file.php on line 14
这里的file.php
require_once("db.php"); // connect
$timeoutseconds = 100;
$timestamp=time();
$timeout=$timestamp-$timeoutseconds;
mysql_db_query($db, "INSERT INTO online VALUES ('$timestamp','$REMOTE_ADDR','$PHP_SELF')") or die("0 Users online"); // this is line 13 that shows error
mysql_db_query($db, "DELETE FROM online WHERE timestamp<$timeout") or die("0 Users online"); // this is line 14 that shows error
代码有没有解释这个错误,以及如何解决它? 〜感谢
注:我知道mysqli
和pdo
但因为我的网站主要取决于mysql
和意志需要几个月做重大调整,因此请你能坚持与mysql
不能转移到任何。
mysqli_ *基本上是mysql_ *带有i。编辑:当然,更新/更好的代码。 – Rogue
你应该更新你的代码来使用mysqli_函数,如果你不使用OO方法,它不应该需要对代码做太多的改变。 – Naryl
停止使用不推荐使用的库。 – Kermit