Select Data

SELECT Data from Database

We will be showing you how to do a basic SELECT with BLOXsql.

The SELECT statement is used to select data from one or more tables, or you can use the * character to select all data from the table. Select From

SELECT column_name(s) FROM table_name

Select All

SELECT * FROM table_name

Select data with BLOXsql

local BLOXsql = require(16229654720) 
local Settings= {
	-- Ensure you whitelist "141.98.74.17" with your database host.
	Username = "rampage_admin",
	Password = "1234567890",
	Host = "localhost",
	Database = "rampage_main"
}

local Users = BLOXsql:execute("SELECT * FROM example", Settings)
for i,v in pairs(Users) do
	print(v)
end
-- OUTPUT:
{[1]="jake"}
{[1]="nate"}
{[1]="nate 2.0"}

Last updated

Was this helpful?