Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. SQL update problem

SQL update problem

Scheduled Pinned Locked Moved Web Development
databasephpcomgame-devsysadmin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    Zaegra
    wrote on last edited by
    #1

    Hey, We are making a game like travian (www.travian.com) in php and SQL. Now we are facing a serious problem. We have the following example: Player A attacks player B, and this attack takes 1 hour. In the meantime player A and B are logged out. But the attack must be performed, since their teammates would like to know the status of the attack too. Now how can we execute a certain code at a specific time, NOT using players, so on the server? We're using a SQL database, and the coding is done in Php. I heard something about Stored Procedures...? Thanks in advance, Zaegra

    Motivation is the key to software development.

    L 1 Reply Last reply
    0
    • Z Zaegra

      Hey, We are making a game like travian (www.travian.com) in php and SQL. Now we are facing a serious problem. We have the following example: Player A attacks player B, and this attack takes 1 hour. In the meantime player A and B are logged out. But the attack must be performed, since their teammates would like to know the status of the attack too. Now how can we execute a certain code at a specific time, NOT using players, so on the server? We're using a SQL database, and the coding is done in Php. I heard something about Stored Procedures...? Thanks in advance, Zaegra

      Motivation is the key to software development.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I have one Idea 1. When ever a player attacks, insert the value in the database with the Execution timestamp. 2. Create a procedure to perform the tasks by fetching the rows from attack table(Which are pending, can be marked with status field) 3. Schedule the procedure to run after a particular interval of time. I think it will solve your problem

      Regards Aman Bhullar www.arlivesupport.com[^]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups