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

AAC Gesior -Achievements error - SQL

Apoccalypse

New Member
Joined
Apr 15, 2017
Messages
114
Solutions
2
Reaction score
4
Hello guys,
I've tried to install this achievements system to my ACC Gesior
[Gesior AAC] Achievements + Secret
but I got an error:
HTML:
Parse error: syntax error, unexpected 'SELECT' (T_STRING) in C:\xampp\htdocs\pages\characters.php on line 145

This is my 145 and 146 line of characters.php:


PHP:
 $achievementPoints = $SQL->query('SELECT SUM(`value`) AS `sum` FROM `player_storage` WHERE `key` LIKE "200%" AND `player_id` = ' . $player->getId())->fetch();
           if(!$achievementPoints['sum']) { $achPoints = '0'; } else { $achPoints = $achievementPoints['sum']; }

I think that a problem is that I have no proper SQL table in my xampp.
Could some help me to create that table?

Thanks for help :)

BUMP
 
Last edited by a moderator:
Hello guys,
I've tried to install this achievements system to my ACC Gesior
[Gesior AAC] Achievements + Secret
but I got an error:
HTML:
Parse error: syntax error, unexpected 'SELECT' (T_STRING) in C:\xampp\htdocs\pages\characters.php on line 145

This is my 145 and 146 line of characters.php:


PHP:
 $achievementPoints = $SQL->query('SELECT SUM(`value`) AS `sum` FROM `player_storage` WHERE `key` LIKE "200%" AND `player_id` = ' . $player->getId())->fetch();
           if(!$achievementPoints['sum']) { $achPoints = '0'; } else { $achPoints = $achievementPoints['sum']; }

I think that a problem is that I have no proper SQL table in my xampp.
Could some help me to create that table?

Thanks for help :)

BUMP

Please read the rules; Rules for the Support board
#5

What TFS version are you running?
 
And what do you mean with this?
I think that a problem is that I have no proper SQL table in my xampp.
Could some help me to create that table?

Are you missing player_storage? Or do you have a database at all?
I can't see any problems with the query
 
0777505e8c46f.png.html

Please don't treat me like an idiot. Of course I have a database :p
Here is a picture of my player_storage table:
Zapodaj.Net - Darmowy hosting zdjęć i obrazków bez rejestracji! - 0777505e8c46f.png

I am for 99% sure that the problem is that in the table is missing a column "sum" ,so the page can not load the value from there and this is why the error pops up.

If someone could help me to add that column to the table that would be great :)
 
Last edited:
0777505e8c46f.png.html

Please don't treat me like an idiot. Of course I have a database :p
Here is a picture of my player_storage table:
Zapodaj.Net - Darmowy hosting zdjęć i obrazków bez rejestracji! - 0777505e8c46f.png

I am for 99% sure that the problem is that in the table is missing a column "sum" ,so the page can not load the value from there and this is why the error pops up.

If someone could help me to add that column to the table that would be great :)

No thats not the problem, it's a variable, ex;
Lua:
local sum = value

Thats why we can use this;
PHP:
$achievementPoints['sum']

But it should work, try setting DEBUG_DATABASE to true (index.php) and take an SS of the errors.
 
I've already had set it.

PHP:
// DATABASE
include_once('./system/load.database.php');
if(DEBUG_DATABASE)
    Website::getDBHandle()->setPrintQueries(true);

Sorry that I am asking but where I can find the error to take a screen shoot of it?
 
I've already had set it.

PHP:
// DATABASE
include_once('./system/load.database.php');
if(DEBUG_DATABASE)
    Website::getDBHandle()->setPrintQueries(true);

Sorry that I am asking but where I can find the error to take a screen shoot of it?

Should be on the page, huge text with all the queries that has been executed, you really can't miss it, I guess 1 query is 5-10 lines.
 
Unfortunately the error from the page still shows the same.

HTML:
Parse error: syntax error, unexpected 'SELECT' (T_STRING) in C:\xampp\htdocs\pages\characters.php on line 146
 
Unfortunately the error from the page still shows the same.

HTML:
Parse error: syntax error, unexpected 'SELECT' (T_STRING) in C:\xampp\htdocs\pages\characters.php on line 146

Just tested to run the query and had no errors (not gesior, some online SQL query verifier).
Try a clean database and see if you get the same issues I suppose.
 
Back
Top