php - How to fix: Warning: mysqli_query() expects parameter 1 to be mysqli? -


i'm trying install arfooo on host.

first got warning about:

deprecated: mysql_connect() 

after fixing that, error:

function executequerywithprefix($sql, $tablesprefix) {     $sql = str_replace("create table `", "create table `" . $tablesprefix, $sql);     $sql = str_replace("into `", "into `" . $tablesprefix, $sql);      //echo $sql."<br>";      return mysqli_query($sql); }  function dbconnect($server, $user, $pass, $dbname) {      /* install database prefixed tables */      mysqli_connect($db_host, $user, $pass, $dbname);     //mysql_connect($server, $user, $pass) or die('could not connect mysql');;      mysqli_query($dbname, 'create temporary table `table`');     //mysql_query('create database if not exists ' . $dbname);      mysqli_select_db($dbname) or die('could not select database'); } 

please help! thanks!

$link = mysqli_connect($db_host, $user, $pass, $dbname);  mysqli_query($link, 'create temporary table `table`'); 

with mysqli need save connection in variable , provide every time use mysqli.

edit: generally: need provide connection every mysqli-related function use.


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -