Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Apr 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Update Multiple records

    I have another problem, does anyone know how to update multiple records at once? I would include the code, but it is like 4 different files and such. But I want to update different records at once using one line of SQL code.

    If I am being too vague, please let me know. I will try and include some code then

  • #2
    New Coder
    Join Date
    Apr 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay, after reading my last post, I was too vague.

    I am trying to develop a system that will track a number of pepole in a party in a game. Example, Party1 has 13 people playing; party2 has 7 people playing; and party3 has 19 pepole playing. I want to update the number of people in each party using one update.

    I Hope that makes things clearer

  • #3
    New Coder
    Join Date
    Aug 2005
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here is your sql code (an example):

    UPDATE table1, table2, table3 SET table1.party = 1, table2.party = 2, table3.party = 3 WHERE table1.id = 4, table2.id = 5, table3.id = 6


    cheers

  • #4
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    cant you just use
    SELECT Party, Count(id) As intPlayerCount FROM Players GROUP BY Party
    to read it dynamically?

    this would return data eg:
    Party1 5
    Party7 9
    SomeGuysParty 2


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •