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 6 of 6
  1. #1
    New Coder
    Join Date
    Oct 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Is this possible

    Ok in my database I have this

    Code:
    id	        pid     one	two	three	four	five	six	red
    000000002956	205	25	0	0	0	0	0	1
    000000002957	205	10	0	0	0	0	0	6
    000000002958	206	16	0	0	0	0	0	1
    000000002959	206	30	0	0	0	0	0	6
    I was wondering if there was something that could do

    if $pid = $thispid && $red = 1 and 6 && $one > $one {$two = 1}

    so the final result would be
    ID 2956 ONE=25 TWO=1
    ID 2957 ONE=10 TWO=0
    and then the reverse for
    ID 2958 ONE=16 TWO=0
    ID 2959 ONE=30 TWO=1

  • #2
    New Coder
    Join Date
    Nov 2007
    Posts
    72
    Thanks
    0
    Thanked 1 Time in 1 Post
    I'm kind of lost here. This is what I've got and you can fill in the blanks:

    if column 'pid' equals a prompted 'thisid' AND column 'red' can equal either 1 OR 6 AND ___

    That's all I've got. $one > $one? I have no idea what this means. If you could maybe clarify like I have for the rest of your question, I could help.

  • #3
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    if $pid = $thispid && $red = 1 and 6 && $one > $one {$two = 1}
    The moral of this story? Don't use symbols in pseudo code.

    What aWishResigned suggests is the proper way of writing pseudo code.

  • #4
    New Coder
    Join Date
    Oct 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    $one would be greater that $one.

  • #5
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    $one must always equal $one

  • #6
    New Coder
    Join Date
    Apr 2007
    Posts
    89
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by Fumigator View Post
    $one must always equal $one
    LOL, unless...

    *chuckle*

    use a while loop (beer + girl means this might need a lot of adjustment )
    PHP Code:

    while( $row mysql_fetchrow($result) ){
    if(
    $pid $thispid ){
      if(
    $red || $red 6){
        
    $c_one $row['one'];

          if(
    $c_one $l_one){
          
    $num_one++;
          
    $l_one $c_one;
          }   
        }
      }



  •  

    Posting Permissions

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