I realize this should be about the simplest thing in the world to do,
but for this reason or that it's not working...
I'm using PHP version 4.2.3
Whether I have a negative number in an array, for example:
$myArray[ID] = -2
Or the number comes from the database, for example:
$row[id] = -2
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;
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
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
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
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
Mail list logo