Recently after my hosting updated its php version i've got error in my website and here is the error message
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
Here is the code of the 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
Is there explain for this error and how can fix it ? ~ thanks
Note : i know about mysqli
and pdo
but can't shift to any since my website depends mainly on mysql
and will needs months to do major changes so please can you stick with mysql
.