311
CHAPTER
Adding Information from a Database 13
Why does the if statement have two equal signs?
PHP uses a double equal sign to test for equality,
and a single equal sign to assign a value to a
variable. Thus, $x = 10 sets the value of the
variable $x to 10 , whereas $x == 10 compares
the value of $x to 10.
Can I test on more than one condition?
Yes. PHP supports the use of if else statements,
which are placed between an if and an else. The
if else statement, like if, takes an expression
as its argument.
● The search page displays
either the results or the no
results message.
i Open the search page in your
browser. Type a term to
search for and click the
form’s button.
28
TIPS