Jump to content

مساعدة في قواعد البيانات


MR.Mosa

Recommended Posts

شباب انا سويت مود في الجريب لست لازم لما اضيف شي يسوي سطور

بس في عندي مشكلة عن الاضافة في الجريت لست  يبقا سطر واحد يضيف عليه

function allInf() 
    local Row = executeSQLQuery("SELECT * FROM SaveCodesNe") 
    if ( type( Row ) == "table" and #Row == 0 or not Row ) then 
         return {} 
    else 
        return Row 
    end 
end 
  
  
  
executeSQLQuery("CREATE TABLE IF NOT EXISTS `SaveCodesNe` (PlayerName TEXT,Serial TEXT)") 
  
        
addEvent("SLL",true) 
addEventHandler("SLL", root, 
function () 
  
local aSerial = getPlayerSerial( source ) 
  
local Results = executeSQLQuery("SELECT * FROM `SaveCodesNe` WHERE Serial=?", tostring (aSerial ) ) 
if ( type ( Results ) == "table" and #Results == 0 or not Results ) then 
executeSQLQuery ( "INSERT INTO `SaveCodesNe` ( PlayerName,Serial ) VALUES(?,?)",tostring (getPlayerName(source)),tostring ( aSerial ) ) 
else 
executeSQLQuery('UPDATE `SaveCodesNe` SET PlayerName =? WHERE Serial =?', tostring (getPlayerName(source)),tostring ( aSerial ))  
end 
end 
) 

 

Edited by MR.Mosa
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...