Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Name: BigShow
Thi shouldn't be that tough. I have two numbers coming out of a db, i put them into variables then try and run an if statement..
if ($a != $b) { show this; }
its not working. the show this always shows. Why would that operator not work. And it seems like it just happened because it was working fine for the past XX amount of years. Thoughts?

php is a "loose" language and *may* be comparing strings to ints or other types as it stores data from the db. If the data being assigned is valid, then what you might try is the settype function.
settype($a, "integer");
settype($b, "integer");if($a != $b) { show this; }

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |