DenizD Posted October 20, 2021 Share Posted October 20, 2021 (edited) --261 local dbid = getElementData(thePlayer, "dbid") --262 local cek = exports.mysql:query_fetch_assoc( "SELECT `chip` FROM `characters` WHERE `id`=" .. mysql:escape_string(dbid) ) --263 --264 --265 if not amount >= cek then --266 outputChatBox("chip ?", thePlayer) --267 return false --268 end [2021-10-21 00:39:38] ERROR: [R]\test-system\test.lua:265: attempt to compare table with boolean or [2021-10-21 00:39:38] ERROR: [R]\test-system\test.lua:265: attempt to compare table with string Edited October 20, 2021 by DenizD Link to comment
Moderators Vinyard Posted October 21, 2021 Moderators Share Posted October 21, 2021 Hi, Your thread has been moved to the scripting section as it's a more appropriate section for your problem. Link to comment
The_GTA Posted October 21, 2021 Share Posted October 21, 2021 Hello DenizD, there are multiple issues with your script. The third-party MTA-MySQL module is outdated. Please use the dbConnect family of functions instead. MySQL queries return a table of multiple possible results. You have to decide which result you want to work with. In the most common scenario it is enough to just get the first-indexed entry of the table (result[1]) and use that one for your code. You have used a non-existant function of an unsupported library. Please use new functions instead. I recommend you to use the dbQuery function. Good luck and have fun! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now