Madriax / Apartments

FiveM script made by Madriax
MIT License
31 stars 20 forks source link

Error when attempting to purchase apartment #17

Open TommyGlock opened 3 years ago

TommyGlock commented 3 years ago

Menu comes up to purchase. When I select "Buy Apartment", it takes the money from me (cash), but nothing else happens in game.

I get the following messages in the console: [ script:Apartments] SCRIPT ERROR: @Apartments/apart_server.lua:61: attempt to call a nil value (method 'executeQuery') [ script:Apartments] > handler (@essentialmode/server/player/login.lua:132) [ script:Apartments] > handler (@Apartments/apart_server.lua:39) [ script:Apartments] SCRIPT ERROR: @Apartments/apart_server.lua:276: attempt to call a nil value (method 'executeQuery') [ script:Apartments] > handler (@essentialmode/server/player/login.lua:132) [ script:Apartments] > handler (@Apartments/apart_server.lua:267) [ script:Apartments] SCRIPT ERROR: @Apartments/apart_server.lua:61: attempt to call a nil value (method 'executeQuery') [ script:Apartments] > handler (@essentialmode/server/player/login.lua:132) [ script:Apartments] > handler (@Apartments/apart_server.lua:39)

I have imported the "user_apartment" SQL in a few times.

Both prerequisites are present and running

TommyGlock commented 3 years ago

These are the lines of code that are creating the errors.

Apartments/apart_server.lua:61 local executed_query = MySQL:executeQuery("SELECT * FROM user_apartment WHERE name = @nom", {['@nom'] = tostring(name)})

Apartments/apart_server.lua:276 local executed_query2 = MySQL:executeQuery("INSERT INTO user_apartment (identifier, name, price) VALUES (@username, @name, @price)", {['@username'] = player, ['@name'] = name, ['@price'] = price})

At no time do I see any data showing in "user_apartment" in the database