...

View Full Version : Is this possible



az_wraith
12-20-2007, 07:20 PM
Ok in my database I have this



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

aWishResigned
12-20-2007, 07:31 PM
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.

aedrin
12-20-2007, 08:26 PM
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.

az_wraith
12-20-2007, 10:02 PM
$one would be greater that $one.

Fumigator
12-20-2007, 10:15 PM
$one must always equal $one :D

psykx
12-21-2007, 02:03 AM
$one must always equal $one :D

LOL, unless...

*chuckle*

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


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

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum