Jump to content

MySQL Passwords...


Recommended Posts

So, I'm kinda new to MySQL and I know what a column/table is etc..

However I don't know some of the MySQL commands like SELECT, INSERT INTO,

I was wondering if someone could send me a link to a decent documentation on MySQL commands please?

Also how would I store encrypted passwords into a SQL database?

Also how do I check the result of a query to see if the email exists in a database?

Link to comment

No, I mean the SELECT FROM INSERT, that kinda stuff, where can I look this up?

Also you know the dbPoll, how I use it to check if a user exists in a database...

i.e

--Check if the email already exists.. 
function emailExists(email) 
    local query = dbQuery ( accountsDatabase, "SELECT * FROM users WHERE email=?", email ) 
    local result = dbPoll ( query, - 1 ) 
    if() then 
        return true 
    else 
        return false 
    end 
end 

how would I finish this code so I can check if the email exists, does dbPoll work like a for loop, does it look through each result, how can I check if email exists in database...

Link to comment
--Check if the email already exists.. 
function emailExists(email) 
    local query = dbQuery(accountsDatabase, "SELECT email FROM users WHERE email=?", email) 
    local result = dbPoll(query, -1) 
    if (result and type(result) == "table" and #result > 0) then 
        return true 
    else 
        return false 
    end 
end 

Link to comment
--Check if the email already exists.. 
function emailExists(email) 
    local query = dbQuery(accountsDatabase, "SELECT email FROM users WHERE email=?", email) 
    local result = dbPoll(query, -1) 
    if (result and type(result) == "table" and #result > 0) then 
        return true 
    else 
        return false 
    end 
end 

It would be much appreciated if you could explain the if statement please, I would really like to know what's going on so I grasp it better.

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