I'm getting this error from a PHP file:
The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead
Here's a copy of the relevant code:
<?php
$con = mysql_connect("localhost","username","password");
if (!$con) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("database_name", $con);
$result = mysql_query("SELECT COUNT(*) FROM `tbltodolist` WHERE status = 'Pending'");
$row = mysql_fetch_array($result);
$total = $row[0];
echo $total;
mysql_close($con);
?>
Is there any simple way to switch this to using mysqli to avoid the error?