Jump to content

executeSQLLol


#Paper

Recommended Posts

I tryed another way to do it: make another table for each data:

function loadPlayerData (player,datatype, num) 
    if (player) and (datatype) and (num) then 
    local serial = getPlayerSerial(player) 
        local findQuery = executeSQLSelect ( datatype, datatype, "serial = '" .. serial .. "'" ) 
        if ( type( findQuery ) == "table" and #findQuery == 0 ) or not findQuery then 
            if num == true then 
                executeSQLCreateTable(datatype, datatype.." INT, serial TEXT") 
                executeSQLInsert ( datatype, "'0', '"..serial.."'") 
            elseif num == false or not num then 
                executeSQLCreateTable(datatype, datatype.." TEXT, serial TEXT") 
                executeSQLInsert ( datatype, "'N/A', '"..serial.."'") 
            end 
        else 
            return findQuery[1][tostring(datatype)] 
        end 
    end 
end 
  
-- Save data to the database 
function savePlayerData (player,datatype,newvalue) 
    if (player) and (datatype) and (newvalue) then 
    local serial = getPlayerSerial(player) 
        local findQuery = executeSQLSelect ( datatype, datatype, "serial = '" .. serial .. "'" ) 
        if ( type( findQuery ) == "table" and #findQuery == 0 ) or not findQuery then 
            if num == true then 
                executeSQLCreateTable(datatype, datatype.." INT, serial TEXT") 
                executeSQLInsert ( datatype, "'0', '"..serial.."'") 
            elseif num == false or not num then 
                executeSQLCreateTable(datatype, datatype.." TEXT, serial TEXT") 
                executeSQLInsert ( datatype, "'N/A', '"..serial.."'") 
            end 
        else 
            executeSQLUpdate ( datatype, datatype.." = '"..newvalue.."'","serial = '" .. serial .. "'" ) 
        end 
    end 
end 

but doesn't work: asdhrv.jpg

First doing this, for be more sure, i putted the default registry.db and internal.db, and doesn't work :S can u fix? pls?

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