ini_set('session.save_path',realpath(dirname($_SERVER['DOCUMENT_ROOT']) . '/tmp/'));
//session_save_path ('/tmp/');
session_start();
$sessionid = session_id();
$db_info["username"] = "szostak_smfvdashboard"; // enter username for the database
$db_info["password"] = "mHt3a896N^Ztxkfae"; // enter password for the database
$db_info["host"] = "localhost"; // enter the host address or leave as local
$db_info["dbname"] = "szostak_smfvdashboard"; // enter the name of the database
$profileFileTypes=Array('jpg','jpeg','png');
?>
# this might not be needed anymore, but we'll keep it just incase.
$tabledInCheck = "Tables_in_".$db_info["dbname"];
//$db_connection = mysql_connect($db_info["host"], $db_info["username"], $db_info["password"]) or die (mysqli_error());
//mysql_select_db($db_info["dbname"], $db_connection) or die (mysqli_error());
global $mysqli;
$mysqli = mysqli_connect($db_info["host"], $db_info["username"], $db_info["password"]);
mysqli_select_db($mysqli,$db_info["dbname"]);
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
function mirage_nocache($sql_query)
{
global $db_connection;
global $db_type;
global $mysqli;
$mirage_resultValue = '';
$result = mysqli_query($mysqli,"$sql_query", $db_connection);
if(is_bool($result)){
if($result) return $result;
else {
echo mysqli_error($db_connection);
}
} else {
$mirage_resultValue= array();
while ($row = mysqli_fetch_array($result)) {
$num_of_fields = mysqli_num_fields($result);
for($k==0;$k<$num_of_fields;$k++){
$field_name = mysqli_fetch_field_direct($result, $k);
$name=$field_name->name;
$value = $row["$name"];
$mirage_resultValue[$name] = $value;
}
}
}
return $mirage_resultValue;
}
function mirage_dbdo($sql_query, $sql_command_type, $alert="0"){
if ($alert==1)
{
print $sql_query."
";
}
global $db_connection;
global $db_type;
global $arrSQLCache;
global $mysqli;
if ($sql_command_type == "SELECT"){
$k=0;
$mirage_resultValue=null;
$result = mysqli_query($mysqli,"$sql_query");//or die("