
Originally Posted by
Mocro
Cant make this to work is it possible to make whole config.php to odbc connection so no mssql connection:
This is from Emisand's Gunz Admin Panel v3 i want it to connect with odbc
Code:
<?php
if( !ereg("index.php", $_SERVER['PHP_SELF']) )
{
header("Location: index.php");
die();
}
///////////////////////////////////
// Emisand's Gunz Admin Panel /////
/// -- Configuration File -- /////
///////////////////////////////////
//MSSQL Server configuration
$_MSSQL[Host] = "COMPUTER\SQLEXPRESS"; // MSSQL Server HOST, it can be an IP Address or a computer name
$_MSSQL[User] = "sa"; // MSSQL User
$_MSSQL[Pass] = ""; // MSSQL Password
$_MSSQL[DBNa] = "GunzDB"; // Gunz Database Name
// Here you set the language for the panel
// If you set this to english, the panel will try to load lang/english.php
$_CONFIG[Language] = "english";
// Gunz Database Configuration
$_CONFIG[AccountTable] = "Account";
$_CONFIG[LoginTable] = "Login";
$_CONFIG[CharTable] = "Character";
$_CONFIG[CItemTable] = "CharacterItem";
$_CONFIG[AItemTable] = "AccountItem";
$_CONFIG[ClanTable] = "Clan";
$_CONFIG[ClanMembTable] = "ClanMember";
$_CONFIG[ClanLogTable] = "ClanGameLog";
// Plugins Configuration
// To Disable, set the variable to 0
// To Enable, set the variable to 1
$_CONFIG[CountryBlock] = 0; // Add functions to Block / Unblock access to your GunZ Server
// to selected countries
?>
From
Code:
$_MSSQL[Host] = "COMPUTER\SQLEXPRESS"; // MSSQL Server HOST, it can be an IP Address or a computer name
$_MSSQL[User] = "sa"; // MSSQL User
$_MSSQL[Pass] = ""; // MSSQL Password
$_MSSQL[DBNa] = "GunzDB"; // Gunz Database Name
To
Code:
$host = "Computer\SQLEXPRESS";
$user = "sa";
$pass = "xxxxx";
$dbname = "GunzDB";
$connect = odbc_connect("Driver={SQL Server};Server={$host}; Database={$dbname}", $user, $pass) or die("Can't connect the MSSQL server.");
i use this to my panel ;) 
Edit
if
Code:
$host = "Computer\SQLEXPRESS";
$user = "sa";
$pass = "xxxxx";
$dbname = "GunzDB";
$connect = odbc_connect("Driver={SQL Server};Server={$host}; Database={$dbname}", $user, $pass) or die("Can't connect the MSSQL server.");
Not work try
Code:
$host = "Computer\SQLEXPRESS";
$user = "sa";
$pass = "xxxx";
$dbname = "GunzDB";
$connect = odbc_connect("Driver={SQL Server};Server={$host}; Database={$dbname}", $user, $pass) or die("Can't connect the MSSQL server.");
function antisql ( $sql ) {
return ( str_replace( "'", "''", $sql ) );
}
im not sure but its work here