PHP Classes

File: Example

Recommend this page to a friend!
  Classes of Thejan   MySQL To MySQLi   Example   Download  
File: Example
Role: Example script
Content type: text/plain
Description: ExampleFile
Class: MySQL To MySQLi
Access a MySQL database using MySQLi
Author: By
Last change:
Date: 9 years ago
Size: 755 bytes
 

Contents

Class file image Download
<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Example
 *
 * @author thejan rajapakshe <coder [dot] clix [at] gmail [dot] com
 */
include 'mysqlToMysqli.php';

class
Example {

    function
example() {
       
$mysql = new mysqlToMysqli('localhost', 'username', 'password', 'database', 3306);
       
        echo
$mysql_info = $mysql->info();
       
       
$mysql_select_result = $mysql->query("SELECT * FROM `Table`;");
       
        while (
$row = mysqli_fetch_array($mysql_select_result)) {
            echo
$row;
        }
       
       
$mysql->closeConnection();
    }

}