SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2001
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    updating the standing

    everyday i understand alot of things in PHP wide world and its really fantastic ... i can manage alot of things easily.

    i am facing a problem during the design of my big project ... look at this page please ...

    http://www.sport.ws/standing.html

    i am trying to make a simple standing that i can update it and view it through the web browser.

    the above link is a simple standing for a competition between supermen ... every week they have a round and earn some points.

    i finished making the table and columns that are needed ... and i succeeded in grapping the results from my table which they are zeros in the above link.

    of course after the first round finish, we will have some results that going to replace the zeros.

    but the updating process still missing in my mind ... hope you help me with the codes.

    thank you
    ONLY LaZiO and ArGaNTiNa ...

  2. #2
    PHP warrior dkode's Avatar
    Join Date
    Sep 2001
    Location
    Planet Namek
    Posts
    329
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you go to mysql.com and search for update it will tell you the syntax for the command...its something like this:

    Code:
    $query = "UPDATE tablename SET fieldname = '$new_value' WHERE id = '$id'";
    Since you didnt give any field names i'm not sure what you want to update but that will give you a general idea...

    http://www.mysql.com
    "Mankind cannot define memory, yet it defines mankind"
    -- Project 2501, Ghost in the Shell

    Smarty | PEAR | PHP Manual | MySQL Manual

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2001
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks .... i am not a newbie to teach me how to use the update command.

    i guess i am so clear ... HOW CAN I UPDATE ALL THE FIELDS ?!
    ONLY LaZiO and ArGaNTiNa ...

  4. #4
    SitePoint Enthusiast
    Join Date
    Sep 2001
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh god ... thanks .... i solved the problem using the for loop with just 1 step ... how smart i am

    anyway, now i can update the table anytime i want with new data.

    the question is ... if i want to order them desc by strength and if the strengths are equal, then i want to compare with the speed. any idea on how to do this ?

    thank you
    ONLY LaZiO and ArGaNTiNa ...

  5. #5
    SitePoint Enthusiast lithium's Avatar
    Join Date
    Sep 2001
    Location
    Jakarta
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can't you just do something like this?

    ... ORDER BY strength DESC, speed DESC



Bookmarks

Posting Permissions

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