• 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!

Database problem (ZNOTEACC) (TFS 1.3)

Xandress

Active Member
Joined
Apr 21, 2020
Messages
65
Reaction score
37
Hi,
I've got a problem with my database (I guess, since the forgottenserver is running and everything works just fine). Im noob with databases and websites too I need someone to take a look at it. The easiest way would be to visit the website www.customa-online.pl, but I'll post the errors aswell.

I'm using an ovh database.

Home
PHP:
No changelogs submitted.string(165) "SELECT `n`.`id`, `n`.`title`, `n`.`text`, `n`.`date`, `p`.`name` FROM `znote_news` AS `n` INNER JOIN `players` AS `p` ON `n`.`pid` = `p`.`id` ORDER BY `n`.`id` DESC;"
(query - SQL error)
Type: select_multi (select multiple rows from database)

Community
XML:
string(583) "SELECT `p`.`name` AS `name`, `p`.`level` AS `level`, `p`.`vocation` AS `vocation`, `g`.`name` AS `gname`, `za`.`flag` AS `flag` , `p`.`lookbody` AS `body`, `p`.`lookfeet` AS `feet`, `p`.`lookhead` AS `head`, `p`.`looklegs` AS `legs`, `p`.`looktype` AS `type`, `p`.`lookaddons` AS `addons` FROM `players_online` AS `o` INNER JOIN `players` AS `p` ON `o`.`player_id` = `p`.`id` INNER JOIN `znote_accounts` AS `za` ON `p`.`account_id` = `za`.`account_id` LEFT JOIN `guild_membership` AS `gm` ON `o`.`player_id` = `gm`.`player_id` LEFT JOIN `guilds` AS `g` ON `gm`.`guild_id` = `g`.`id`;"
(query - SQL error)
Type: select_multi (select multiple rows from database)

Thanks in advance.
 
I've just uploaded the newest znote from github and nothing changed.

I forgot to admit that I did those changes to connect the database:

in database -> connect.php
PHP:
$connect = new mysqli
add
PHP:
$config['sqlPort'],
then in config.php
PHP:
$config['sqlPort'] = 'yourport';
below the host.
 
Is there a reason you can't use the default port?

Make sure that $config['sqlPort'] is an int (number) and not a string.
PHP:
$config['sqlPort'] = 3306 # Good
$config['sqlPort'] = '3306' # Bad
Did you add the port at the correct place in the constructor?
PHP:
$connect = new mysqli($config['sqlHost'], $config['sqlUser'], $config['sqlPassword'], $config['sqlDatabase'], $config['sqlPort']);
I'm using an ovh database.
Is the database on a separate server? If so you need to configure MySQL to allow logins from your website and probably open whatever port you're using. I have no experience with OVH or hosting the database separately so I can't say exactly how to do that.
 
Ive got a VPS and database on another host, both from OVH. The port was different than 3306 when i bought it, I don't know if I can change that either.
I did change the port for a number (thanks, it was string) but the errors are still here.
When I put my
PHP:
&config['sqlPort']
at the end as you seggested i got an error: Failed to connect to MySQL: (2002) Connection refused.

Website IP is already on a authorised-IP in my database.
 
Last edited:
Back
Top