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

Gesior Acc. Problems

Zer0xe

Freedom, Health & Courage
Joined
Aug 3, 2007
Messages
643
Reaction score
2
Location
Sweden
Hello.
When I try to create a character on my Gesior Page, I'm getting this error
Code:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `player_id` = 8 AND `skillid` = 0' at line 1' in C:\xampp\htdocs\eng\tibia_beta\pot\OTS_Player.php:184 Stack trace: #0 C:\xampp\htdocs\eng\tibia_beta\pot\OTS_Player.php(184): PDO->query('UPDATE `player_...') #1 C:\xampp\htdocs\eng\tibia_beta\accountmanagement.php(710): OTS_Player->save() #2 C:\xampp\htdocs\eng\tibia_beta\index.php(144): include('C:\xampp\htdocs...') #3 {main} thrown in C:\xampp\htdocs\eng\tibia_beta\pot\OTS_Player.php on line 184
So I'm wondering if anyone know what's wrong? I know It's something in OTS_Player.php but I can't figure it out, really.

All help will be appreciated,
help will also be rep++

Thanks.
Zer0xe.
 
What TFS server do you use: 0.3.x or 0.2.x ?

And post here the lines:

Line 184 from OTS_Player.php
Line 710 from accountmanagement.php
 
I use TFS 0.2.x

Like 184 from OTS_Player.php
PHP:
           $this->db->query('UPDATE ' . $this->db->tableName('player_skills') . ' SET ' . $this->db->fieldName('value') . ' = ' . $skill['value'] . ', ' . $this->db->fieldName('count') . ' = ' . $skill['tries'] . ' WHERE ' . $this->db->fieldName('player_id') . ' = ' . $this->data['id'] . ' AND ' . $this->db->fieldName('skillid') . ' = ' . $id);

Line 710 from accountmanagement.php
PHP:
					$player->save();
 
It looks to me like you don't have any triggers in your database.
That's why it can't update the created chars skills, because they don't exist.

If your using 0.3x just run the server and they should be created automatically. (The triggers I mean)
If your using 0.2x then just import them from your forgottenserver.sql
 
I'm sorry but I am a little newbie with websites. I solved a lot of my problems (I mean mine) anothers not and I asked for help like you. I tried to help you, but I don't know what cause this problem.
Maybe you are using Unnamed acc. maker 0.3.2beta2 for TFS 0.3 beta instead of UNNAMED Acc. maker 0.3.1a for TFS from 0.2.6 (0.2 rc 6) to 0.2.2? (0.2 rc 14) (you must use this).

Sorry.
 
It looks to me like you don't have any triggers in your database.
That's why it can't update the created chars skills, because they don't exist.

If your using 0.3x just run the server and they should be created automatically. (The triggers I mean)

I use 0.2.X :/ Is there a way I could import/SQL the triggers? Or do I have too make them myself? Or prehaps that's the only solution for that.

I'm sorry but I am a little newbie with websites. I solved a lot of my problems (I mean mine) anothers not and I asked for help like you. I tried to help you, but I don't know what cause this problem.
Maybe you are using Unnamed acc. maker 0.3.2beta2 for TFS 0.3 beta instead of UNNAMED Acc. maker 0.3.1a for TFS from 0.2.6 (0.2 rc 6) to 0.2.2? (0.2 rc 14) (you must use this).

Sorry.

Hmm, I'm not sure of which one I use :/ Hmm... I'll have to check it up, yeps.


Thanks both of you though.
Zer0xe.
 
Execute on phpMyAdmin:

PHP:
DROP TRIGGER IF EXISTS `oncreate_players`;
DROP TRIGGER IF EXISTS `oncreate_guilds`;
DROP TRIGGER IF EXISTS `ondelete_players`;
DROP TRIGGER IF EXISTS `ondelete_guilds`;
DROP TRIGGER IF EXISTS `ondelete_accounts`;

PHP:
CREATE TRIGGER `ondelete_accounts`
BEFORE DELETE
ON `accounts`
FOR EACH ROW
BEGIN
    DELETE FROM `bans` WHERE `account` = OLD.`id`;
END|

CREATE TRIGGER `ondelete_guilds`
BEFORE DELETE
ON `guilds`
FOR EACH ROW
BEGIN
    UPDATE `players` SET `guildnick` = '', `rank_id` = 0 WHERE `rank_id` IN (SELECT `id` FROM `guild_ranks` WHERE `guild_id` = OLD.`id`);
END|

CREATE TRIGGER `ondelete_players`
BEFORE DELETE
ON `players`
FOR EACH ROW
BEGIN
    DELETE FROM `bans` WHERE `type` = 2 AND `player` = OLD.`id`;
    UPDATE `houses` SET `owner` = 0 WHERE `owner` = OLD.`id`;
END|

CREATE TRIGGER `oncreate_guilds`
AFTER INSERT
ON `guilds`
FOR EACH ROW
BEGIN
    INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('the Leader', 3, NEW.`id`);
    INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('a Vice-Leader', 2, NEW.`id`);
    INSERT INTO `guild_ranks` (`name`, `level`, `guild_id`) VALUES ('a Member', 1, NEW.`id`);
END|

CREATE TRIGGER `oncreate_players`
AFTER INSERT
ON `players`
FOR EACH ROW
BEGIN
    INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 0, 10);
    INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 1, 10);
    INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 2, 10);
    INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 3, 10);
    INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 4, 10);
    INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 5, 10);
    INSERT INTO `player_skills` (`player_id`, `skillid`, `value`) VALUES (NEW.`id`, 6, 10);
END|

DELIMITER ;
 
Error while Executing =/
Code:
Fel

SQL-fråga:

CREATE TRIGGER `ondelete_accounts` BEFORE DELETE ON `accounts` FOR EACH ROW BEGIN DELETE FROM `bans` WHERE `account` = OLD.`id` ;

MySQL sa: Dokumentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 6
 
Sorry, I g2g yesterday. Execute them from your sql file inside you server folder (schema.(my)sql normally).
 
Back
Top Bottom