I am looking to test a field in my database using a php script. The filed carries an integer. I want to test if number is greater the 52 then do something...
I think augustine forgot to tell you that you must first specify the $value before it could work.
Maybe like in a form where a user enters a number and that will make the variable $value have a number before testing it.
Good luck with the coding
Sometimes you only need the IF statement to execute a block of coding upon a certain condition. Other times, you will want to execute either this or that block of coding depending if the condition value is true or false. That is when ELSE comes into play.
good point ~cristobal
Code:
<?php
$test = 52;
if ($test > 52) {
echo "Yes, $test is greater than 52.";
} else {
echo "No, $test is less than 52.";
}
?>