I have an outdated php/mysql script that isn't working, due to a server software upgrade.
Here are some lines from the error log:
[03-Apr-2017 04:05:16 UTC] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead start.php on line 18
[03-Apr-2017 04:05:16 UTC] PHP Deprecated: Function mysql_numrows() is deprecated in library.php on line 135
This is line 18 onwards
$connection=mysql_connect($sqlserver,$db_login,$db_pass) or die('Could not connect to the database server');
$db = mysql_select_db($db_name, $connection) or die ("Unable to select database.");
$sql="SELECT IP,Date FROM users WHERE IP='$IP' ORDER BY Date DESC LIMIT 1";
and this is line 135 onwards
for($i=0;$i<mysql_numrows($result);$i++){
for($j=0;$j<mysql_num_fields($result);$j++){
$ranges[$i][mysql_field_name($result,$j)] = mysql_result($result,$i,mysql_field_name($result,$j));
}//end inner loop
}//end outer loop
I am not a programmer, can this be solved with a find replace?
If the changes don't work, what further information would be needed?
Thanks!