AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   mysql (https://forums.alliedmods.net/showthread.php?t=13974)

lai 06-05-2005 06:01

mysql
 
i want to update the table with the player infos
Code:

public update_frags() {
 
  new csname[32]
  new csfrags
  new csid
  new players[32]
  new i
  new inum
  get_players(players,inum)
  for(i = 0 ;i < inum; ++i)
  {
    get_user_name(players[i],csname,32)
    csfrags = get_user_frags(players[i])
    csid = get_user_userid(players[i])
    if(dbi_num_rows(result)>0) {
      new query_b[1024]
      format(query_b,1024,"INSERT INTO Entertainment Set csid='%s',csfrags=%i,csname='%s'",csid,csfrags,csname)
      dbi_query(dbc,query_b)
      }
      else
      {
        server_print("Error")
      }

    new query_c[1024]
    format(query_c,1024,"UPDATE Entertainment csfrags=%i,csid='%s' WHERE csname='%s'",csfrags,csid,csname)
    dbi_query(dbc,query_c)
 
  }
  return PLUGIN_CONTINUE
}

the update doesnt work....

Please help!
Thanks


All times are GMT -4. The time now is 16:47.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.