Ok trying to convert to the mysqli protocols. Having issues.
Under mysql I've always connected to the database in an included connect file. I tried to just convert the connect file to mysqli object oriented style and then convert the various mysql statements in my programs to the mysqli object equivalents of the mysql statements.
here is the connect file (minus the values for the database variables):
$mysqli = new mysqli($DB_HOST, $DB_USER, $DB_PASS, $DB_NAME);
if ($mysqli->connect_errno) {
echo "Failed to connect to MySQL: " . $mysqli->connect_error;
}
Here is the first of dozens of statements which didn't work.
function configs($shop){
global $cnfig;
$query="selectcvar
,cval
fromconfigs
where shop='".$shop."' order bycvar
ASC";
$result=$mysqli->query($query);
while ($row = $result->fetch_object){
$cnfig[$row->cvar]=$row->cval;
}
}
This results in the error: Call to a member function query() on a non-object
I totally don't understand because I followed the exact format shown in the php docs. What did I miss?:eek: