+1 vote
by
There is a store in 2005 made in Shop Script free, all works fine, but since the hosting and Opencart installed and the latest versions that require PHP 7.4, then the old store should be translated. And the old store has MySQL instead of MySQLI. I do not understand it at all.

There is a code to connect to the database. Naturally, simply renaming mysql to mysqli does nothing but cause an error Warning: mysqli_query() expects at least 2 parameters, 1 given in
<?php

function db_connect($host,$user,$pass)
{
$r = mysql_connect($host,$user,$pass);
if(preg_match('/^5\./',mysql_get_server_info($r)))db_query('SET SESSION sql_mode=0');
mysql_query("SET NAMES utf8") or die("Invalid query: ".mysql_error());
return $r;
}


function db_select_db($name)
{
return mysql_select_db($name);
}

function db_query($s)
{
return mysql_query($s);
}

function db_fetch_row($q)
{
return mysql_fetch_row($q);
}

function db_insert_id()
{
return mysql_insert_id();
}

function db_error()
{
return mysql_error();
}

?>
Please tell me what to fix.

1 Answer

0 votes
by
 
Best answer
...