I've been running a cronjob MySQL script that was working great but became deprecated and won't work anymore. I've taken a number of stabs at updating to mysqli, I can get an echo result in the logs of "ok!" but the actual query doesn't get run anymore.
This renders the cronjob moot as the main objective is to select the table 'h2lb9_users' and update the column 'block' to 0 for all rows. I'm doing this as a favor to a friend so your assistance is greatly appreciated.
NEW ATTEMPT:
<?php
$username="HERE";
$password="HERE";
$dbname="HERE";
$dbhost="localhost";
$query="update h2lb9_users set 'block' = 0";
$connection = mysqli_connect($dbhost,$dbname,$username,$password);
mysqli_select_db($connection,"I write out dbname here");
mysqli_query($query);
mysqli_close();
echo strftime('%c')." ok!";
?>
This was the old code that was working:
OLD WAS WORKING:
<?php
$username="HERE";
$password="HERE";
$dbname="HERE";
$dbhost="localhost";
$query="update h2lb9_users set `block` = 0";
mysql_connect($dbhost,$username,$password);
@mysql_select_db($dbname) or die(strftime('%c')." Unable to select database");
mysql_query($query);
mysql_close();
echo strftime('%c')." ok!";
?>