Page 1 of 1

question on boolean AND

Posted: Sat Jul 19, 2008 11:37 pm
by verymeanguy
I have a code

Code: Select all

 
<?php
if(isset($_POST['name']))&&(isset($_POST['title']))&&(isset($_POST['text'])){
 
//blah blah blah...
 
}
But php says

Parse error: parse error, unexpected T_BOOLEAN_AND in c:\www\dbtest2.php on line 2

Why isn't the boolean AND (&&) not working here?

Re: question on boolean AND

Posted: Sun Jul 20, 2008 12:42 pm
by EverLearning
You need parenthesis around the whole statement. It should look like this:

Code: Select all

if ( (isset($_POST['name'])) && (isset($_POST['title'])) && (isset($_POST['text'])) ) {
 
//blah blah blah...
 
}