Showing posts with label mysqli. Show all posts
Showing posts with label mysqli. Show all posts

Friday, September 27, 2019

Convert mysql to mysqli

Today to want to share how i convert from old system that using mysql to mysqli..

First this is for config file.

mysql



mysqli

 

changes also have to do in fn file

mysql



mysqli



Can you see the different that you have to add or adjust a bit.

in your files where your actual code to show add those file in the beginning.

<?php
session_start();
include_once 'include/config.php';
include_once 'include/fn.php';
?>

like this.
 

connect to MySqli using class

Today I want to show you guys how to connect to mysqli using class. You need to have 3 files.

config.php (your database connection)



fn.php (act as controller)



index.php (this is where you files are)



I'm using this code when i have to convert the old system in PHP 5.2 to PHP 7.1..
Amazingly it works.

LinkWithin

Related Posts Plugin for WordPress, Blogger...