I am getting a couple of errors when it comes to the use of MySql instead of MySqli. That MySql had been depracated. I am applying MySqli functions in the website, yet something that I need in the database connection folder uses MySql. I have tried reading the PHP MySqli documentation in order to figure out how to change it to MySqli, but it didn't work.
The function is:
This is to establish a connection to the MySql server
$this->conn = $func($this->host, $this->user, $this->password);
if (!$this->conn) {
return false;
}
And the following is to request the database
if (@!mysql_select_db($this->database, $this->conn)) {
return false;
}
return true;
}
Another thing that is happening is that in the admin panel I am trying to create page numberings to fetch the data, since sometimes the data inputted is too much. I am doing this through a for loop from the $start till the $end with an incrementation of i. What's happening is that I am using the mysql_result(), when I switch to mysqli it gives an error that this function is not defined. I tried using mysqli_fetch_all() yet it didnt work.
The following code is happening through the for loop that I mentioned above:
echo '<td>' . mysqli_result($result, $i, 'productid') . '</td>';
echo '<td>' . mysqli_result($result, $i, 'productname') . '</td>';
The error given for the above code is:
Call to undefined function mysqli_result()