How to update the game count within a query if the Raw Score is greater than 0?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Roger Fain
    New Member
    • Feb 2011
    • 3

    How to update the game count within a query if the Raw Score is greater than 0?

    Code:
    $res = mysql_query("UPDATE Player_Master, Round1
     	SET Player_Master.Total_Raw=(Player_Master.Total_Raw)+(Round1.Player1_Raw),
    		if Round1.Player_Raw > 0 Player_Master.Games=(Player_Master.Games+1)
        WHERE Player_Master.Player_ID=Round1.Player1_ID")or exit( mysql_error() ) ; 
     if( $res ) echo  " Round1 Player1 Done.";
    this is inside php
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    What is the problem?

    Comment

    • Roger Fain
      New Member
      • Feb 2011
      • 3

      #3
      I am sorry.........I am getting a syntax error on the if statement

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        I was under the impression that IF is supposed to be a function of the format IF(expression, true value, false value)

        Comment

        Working...