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

Solved [ZNOTE AAC] - Query Usage / security

Xevomu

New Member
Joined
Oct 23, 2018
Messages
10
Reaction score
1
Hello!
I have doubts as to the safe use by select/insert/updates with querys in znote aac.

1)
Is it better to use a mysqli_connect or use the znote functions?

2)
What is the safest way to protect against sql-injection?
Code:
mysqli_query($connection, "UPDATE znote_accounts SET points = '$points' WHERE account_id = '$accountid' LIMIT 1");
or
Code:
mysqli_query($connection, "UPDATE znote_accounts SET points = '" . $points. "' WHERE account_id = '". $accountid . "' LIMIT 1");
or
Code:
mysql_update("UPDATE znote_accounts SET points = '$points' WHERE account_id = '$accountid' LIMIT 1;");
or
Code:
mysql_update("UPDATE znote_accounts SET points = '" . $points. "' WHERE account_id = '". $accountid . "' LIMIT 1;");
 
Solution
@Webtimize you're right. But the more simple way is develop a function to protect all queries! (at this time)

OR... you can RE-implement all your library with PDO (OOP). You'll spend more time in a "small" project in my opinion.

Time > OR < Valuation
@Webtimize you're right. But the more simple way is develop a function to protect all queries! (at this time)

OR... you can RE-implement all your library with PDO (OOP). You'll spend more time in a "small" project in my opinion.

Time > OR < Valuation
 
Solution
@Webtimize you're right. But the more simple way is develop a function to protect all queries! (at this time)

OR... you can RE-implement all your library with PDO (OOP). You'll spend more time in a "small" project in my opinion.

Time > OR < Valuation

Znote and gesior are shit in general.

Most of the code is cluttered, unreadable and/or outdated. Most of the times error_reporting is turned off, just because the application itself is poorly designed and written from the bottom up. Going over all queries and refactor them (+ additional testing) would be a waste of time imo, since that'd be patching a sinking ship.

@ts; MyAAC by Slawkens is pretty dope, and actually being updated.
slawkens/myaac
 
Back
Top