Re: [PHP] testing for negative numbers

2003-02-06 Thread Rasmus Lerdorf
Please provide a complete test script. Are you perhaps not realizing that array indices along with all variables in PHP are case sensitive? $row[ID] and $row[id] are not the same thing. The trivial test of your example: $myArray[id] = -2; if ($myArray[id] 0) echo Negative;

Re: [PHP] testing for negative numbers

2003-02-06 Thread Robert Samuel White
Hi Rasmus: Yes, I'm totally aware of case sensitivity...and basically the script you wrote here is exactly what I'm trying to doing. This is a problem I've been having with several scripts...always when the number is negative. I've also echoed my variables just to make sure they are in fact

Re: [PHP] testing for negative numbers

2003-02-06 Thread Robert Samuel White
Well, I just tried your test script and that works just as it should, so I must be having some other issue. But that still doesn't explain why I can print out the results of $row[dir_id] and it shows it being -2, yet my script (as printed in the last email) never makes it to the correct

Re: [PHP] testing for negative numbers

2003-02-06 Thread Leif K-Brooks
Is it possible that the value is actually -2 (with the space)? Robert Samuel White wrote: Well, I just tried your test script and that works just as it should, so I must be having some other issue. But that still doesn't explain why I can print out the results of $row[dir_id] and it shows

Re: [PHP] testing for negative numbers

2003-02-06 Thread Robert Samuel White
Okay, I'm an idiot. It *was* making it to the statement, but the row_id in the table matrix_structure_routes are actually positive numbers, so when it gets to that point I need to use the absolute value. The reason for using the negative and postive counterparts are to determine which type