Jump to content

jokerjab

Members
  • Posts

    2
  • Joined

  • Last visited

Details

  • Gang
    DWAG

jokerjab's Achievements

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody.

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody. (2/54)

0

Reputation

  1. Thanks it works in this way. I was really going to do it in this way local Health = executeSQLQuery("SELECT * FROM aa WHERE Health = ?", asa) but after reading this tutorial kinda confused me but anyway I learned my lesson and next time I will go with wiki examples.
  2. jokerjab

    SQL problem

    Hello guys, I'm having some problems with SQL. When I insert rows into columns and update it with new values so the old ones are replaced with the new ones, right? Ok so the second question is that how do I loop through the rows? It still keep giving me the same 100 value. function SQLTest() if executeSQLQuery("CREATE TABLE IF NOT EXISTS aa(Name TEXT, Cash NUMBER, Health NUMBER)") then if executeSQLQuery("INSERT INTO aa(Name, Cash, Health) VALUES(?,?,?)", "myName", 1554, 100 ) then -- 100 health local asa = 150 + getElementHealth(getPlayerFromName("What?")) -- should be 100 + now if executeSQLQuery("UPDATE aa SET Name = ?,Cash= ?,Health = ? WHERE Health = '"..asa.."'", "myName", 140, 100) then -- executed local Health = executeSQLQuery("SELECT * FROM aa WHERE Health = ?", 100) -- selected if #Health ~= 0 then outputChatBox ( Health[1]["Health"] ) -- but still the same 100 end end end end end SQLTest() This outputs 100? I think I'm updating it incorrectly any idea?
×
×
  • Create New...