I'm using mysqli instead of mysql, and came across the error Call to undefined function mysqli_result()
From looking on Google, the general consensus is that mysql_result was a useless function anyway and there is no need for it in the MySQLi library. However, I think it is useful and can't see what's wrong with the following code?
do
{
$id = rand_id();
$exists = mysql_query('SELECT EXISTS(SELECT 1 FROM `files` WHERE `name` = "' . $id . '")');
}
while (mysql_result($exists, 0) === 1);
Is there a way to replicate the way mysql_result worked without changing the code too much?