Jump to content

executeMySQL


Lloyd Logan

Recommended Posts

Posted

Hey,

I have been struggling for ages, and i can't quite get this to work :(

So I am looking to update the players rank when he logs in (dont ask why), the rank in located in Localhost db = newser

structure(<--- I think thats what its called) = account, then it is under the players name then admin, here is what i have so far?

newserv = dbConnect( "mysql", "dbname=newserv;host=127.0.0.1", "root", "" ) 
  
function makeadminn (thePlayer) 
        executeSQLQuery("UPDATE `account` SET `**dont know what to put here`=?, WHERE `admin`=2", thePlayer) 
end 
addCommandHandler("makemeadmin", makeadminn) 

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted

executeSQLQuery is for SQLite only, you must use dbExec instead.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
executeSQLQuery is for SQLite only, you must use dbExec instead.

Ahh, so what would i do?

dbExec( connection, "UPDATE ?? SET ??=?", tableName, columnName, columnValue  

I don't understand what to replace with what?

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted
dbExec ( connection, "UPDATE `accounts` SET `admin` = '2' WHERE `accountName` = 'Lloyd Logan" ) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
dbExec ( connection, "UPDATE `accounts` SET `admin` = '2' WHERE `accountName` = 'Lloyd Logan" ) 

Thank you so much!!! Where you have put "Lloyd Logan" how would I replace that with whoever has logged in?

Like getPlayerName? Then how would I implement this into the script?

Thanks Again

Lloyd

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted
dbExec ( connection, "UPDATE `accounts` SET `admin` = '2' WHERE `accountName` = ".. name .."" ) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
dbExec ( connection, "UPDATE `accounts` SET `admin` = '2' WHERE `accountName` = ".. name .."" ) 

That simple? name = getPlayerName then the dnExec?

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

Posted
Yes, that's right.

Thanks again Castillo!

If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE

SCOTLAND, my hometown, and the Home of GTA!

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