Hi I am trying to convert the following mysql function to mysqli.
Thanks in advance
David
<?php
/*-------------------------------------------------
This class contains generic database functions to
view, add, edit and delete all facets of a database
-------------------------------------------------*/
require_once ("sitesettings.php");
class Database extends SiteSettings {
var $Query;
var $Connection;
function Database() {
$Settings = SiteSettings::SettingValues();
$Hostname = $Settings['DB-Hostname'];
$Username = $Settings['DB-Username'];
$Password = $Settings['DB-Password'];
$Database = $Settings['DB-Database'];
$this->Connection = mysql_connect($Hostname, $Username, $Password);
mysql_select_db($Database);
register_shutdown_function(array(&$this, "close"));
}
function Execute($SQL) {
$this->Query = $SQL;
return mysql_query($SQL, $this->Connection);
}
function Records($SQL) {
return mysql_fetch_array($SQL);
}
function RecordCount($SQL) {
return mysql_num_rows($SQL);
}
function Close() {
mysql_close($this->Connection);
}
}
?>