hi i am attempting to change my connection from mysql to mysqli so far i have gone through all the files in the script and replaced mysql with mysql and i went to check what id done so far and i got the following error can anyone help in this ty jan x

Warning: mysqli_select_db() expects parameter 1 to be mysqli, string given in /home/jktempla/public_html/Escort/config/db_connect.php on line 6

Warning: mysqli_errno() expects exactly 1 parameter, 0 given in /home/jktempla/public_html/Escort/config/db_connect.php on line 6

This is the code for that section in the db_connection.php

$conn       = mysqli_connect(DBHOST,DBUSER,DBPASS) or die(mysqli_errno());
$dn         = mysqli_select_db(DBNAME,$conn) or die(mysqli_errno());

$row        = mysqli_fetch_array(mysqli_query("select * from settings where id = '1' "));
$site_name  = trim(stripslashes($row['site_name']));
$email      = trim($row['email']);
$keyword    = trim(stripslashes($row['keyword']));
$description= trim(stripslashes($row['description']));
$logo       = trim($row['logo']);
$copyright  = trim(stripslashes($row['copyright']));

And heres the database file

define ("DBHOST","localhost");
define ("DBUSER","******");
define ("DBPASS","******");
define ("DBNAME","*****");

/*define ("DBUSER","root");
define ("DBPASS","");
define ("DBNAME","date_demo");*/

define ("DBPREFIX","");
define ("CHAR_SET","utf8");
define ("CACHEDIR","");

Member Avatar for diafol

If you read the php manual on procedural mysqli, you'll find the connection object, or more correctly, "the link identifier" (usually denoted by $link) is the first parameter in the functions.


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.