• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

how config gesior for remote access data base!!!

ninexin

insane.sytes.net
Joined
Jun 10, 2007
Messages
213
Reaction score
3
Location
Brazil
i have one server running with MySQL Server and i allowed remote access on the hoster and have one Dominio .com,
but how do I configure the config-and-functions.php for access db of my hoster

look

PHP:
<?PHP
// ###################### CONFIG ########################
//load page config file
$config['site'] = parse_ini_file('config/config.ini');
include('config/config.php');
//check install
if($config['site']['install'] != "no")
{
header("Location: install.php");
exit;
}
//load server config
$config['server'] = parse_ini_file($config['site']['server_path'].'config.lua');
if(isset($config['server']['mysqlHost']))
{
//new (0.2.6+) ots config.lua file
$mysqlhost = $config['server']['mysqlHost'];
$mysqluser = $config['server']['mysqlUser'];
$mysqlpass = $config['server']['mysqlPass'];
$mysqldatabase = $config['server']['mysqlDatabase'];
}
elseif(isset($config['server']['sqlHost']))
{
//old (0.2.4) ots config.lua file
$mysqlhost = $config['server']['sqlHost'];
$mysqluser = $config['server']['sqlUser'];
$mysqlpass = $config['server']['sqlPass'];
$mysqldatabase = $config['server']['sqlDatabase'];
}
$sqlitefile = $config['server']['sqliteDatabase'];
$passwordency = '';
if(strtolower($config['server']['encryptionType']) == 'md5')
$passwordency = 'md5';
if(strtolower($config['server']['encryptionType']) == 'sha1')
$passwordency = 'sha1';
// loads #####POT mainfile#####
include('pot/OTS.php');
// PDO and POT connects to database
$ots = POT::getInstance();
if(strtolower($config['server']['sqlType']) == "mysql")
{
//connect to MySQL database
try
{
$ots->connect(POT::DB_MYSQL, array('host' => $mysqlhost, 'user' => $mysqluser, 'password' => $mysqlpass, 'database' => $mysqldatabase) );
}
catch(PDOException $error)
{
echo 'Database error - can\'t connect to MySQL database. Possible reasons:<br>1. MySQL server is not running on host.<br>2. MySQL user, password, database or host isn\'t configured in: <b>'.$config['site']['server_path'].'config.lua</b> .<br>3. MySQL user, password, database or host is wrong.';
exit;
}
}
elseif(strtolower($config['server']['sqlType']) == "sqlite")
{

i need HELPP PLXXXXXX
i REP++ for THIS

SRY mY BAD Inglish IM FROM BRAZIL
 
Add config.lua a of in your site.
with all the information the your server.
change:
ip = "127.0.0.1" <-- ip hoster
sqlHost = "localhost" <-- ip hoster
sqlPort = 3306
sqlUser = "root"
sqlPass = "xxxx" <--- db pass
sqlDatabase = "xxxxx" <--- db name
 
not, the database is in the hoster, and my web site is in a domain .com

need change the script in config-and-functions.php
but I do not know exactly how
need one example plx plx plx
 
mano vc é brasileiro e eu me matando pra traduzi as parada :P
UAHuHAuHAUhAuahUAHA

intão mano nao intendi pq é assim meu servidor roda em um hoster nos EUA e meu site esta em uma hospedagem linux
então nao tem como o site acessar a pasta onde esta o config.lua pois eles nao estao na mesma maquina manjou???
me dizzz o que tem que fazer pq eu sei que tem uma forma do site se conectar remotamente no database que esta no hoster
com modern acc eu conssigo + meu server sempre uso gesior ae ta foda de usa modern acc pois da varios bugs pois minha db tem mta coisa que no modern nao tem
ae preciso fazer isso com gesior ta foda bro me ajudaa porfavor!!!!

da uma olhada
meu site atual do meu OT -> CastleHell - Latest News
e esse é o dominio que eu quero que ele va -> www.castlehell.com

abrass bro
desde ja agradeço
 
add config.lua a of in your site.
With all the information the your server.
Change:
Ip = "127.0.0.1" <-- ip hoster
sqlhost = "localhost" <-- ip hoster
sqlport = 3306
sqluser = "root"
sqlpass = "xxxx" <--- db pass
sqldatabase = "xxxxx" <--- db name

is working right, but I found an error, the site is no longer create accounts and players!

this showing that:

PHP:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1364 Field 'page_lastday' doesn't have a default value' in /home/castlehe/public_html/pot/OTS_Account.php:199 Stack trace: #0 /home/castlehe/public_html/pot/OTS_Account.php(199): PDO->query('INSERT INTO `ac...') #1 /home/castlehe/public_html/createaccount.php(282): OTS_Account->create(0, 9999999, 'FODAO') #2 /home/castlehe/public_html/index.php(147): include('/home/castlehe/...') #3 {main} thrown in /home/castlehe/public_html/pot/OTS_Account.php on line 199

and

PHP:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1364 Field 'comment' doesn't have a default value' in /home/castlehe/public_html/pot/OTS_Player.php:187 Stack trace: #0 /home/castlehe/public_html/pot/OTS_Player.php(187): PDO->query('INSERT INTO `pl...') #1 /home/castlehe/public_html/accountmanagement.php(952): OTS_Player->save() #2 /home/castlehe/public_html/index.php(141): include('/home/castlehe/...') #3 {main} thrown in /home/castlehe/public_html/pot/OTS_Player.php on line 187

look here:

www.castlehell.com
 
Last edited:

Similar threads

Replies
1
Views
683
Back
Top