Jump to content

Help with SQL


enzoDs

Recommended Posts

 
Hi, I need to run a SQL Query from the client side and I can't do it. I don't know what else to explain, basically I need the client to execute what is in the spoiler and return the value on the client side 
(Google translate)
local players = executeSQLQuery("SELECT id, name FROM players WHERE money > ?", tonumber(amount))

 

Link to comment

The client itself doesn't and shouldn't have access to the SQL database. If you need to run an SQL command upon the request of a client, do so by having the client triggerServerEvent and the server executeSQLQuery. Do not let the client choose what query to run. The server should always build the query and look out for and prevent possibilities of SQL injection (e.g. a client asking the server to remove the whole database - big no-no).

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...