Jump to content

MySQL Help, URGENT


flowz

Recommended Posts

  
local connection = dbConnect("mysql","see_wiki") 
dbExec(connection, "CREATE TABLE IF NOT EXISTS tableName(column1,blablabla)") -- to create a table if it doesn't exist 
dbExec(connection, "INSERT INTO tableName VALUES(?,?,?)", "what", "hi", "bye") -- To insert a value into a TABLE. NOTE VALUS(?,?,?) should have question marks depending on columns. If columns are two there will be 2 question markers. and then it must be inserted after a comma. 
local query = dbQuery(connection,"SELECT * FROM tableName") -- Selects everything from the tableName! 
local poll = dbPoll(query,-1) -- Gets the result until it doesn't come 
answer = poll[1] -- The result is this. 
local query2 = dbQuery(connection,"SELECT column1 FROM tableName") -- selects column1 from a table name! 
local poll = dbPoll(query,-1) -- told before  
answer = poll[1] -- told before too  
  

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...