PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
elseif ($_POST['1'] == x and $_POST['2'] == y and $_POST['3'] !== z or a)
{
$errors[] = 'Error';
}
It isn't functioning how I want it to. I want it to come up with an error message if post 3 does not equal 'z' or 'a'. However, it comes up with the error message regardless of whether post 3 is 'z' or 'a'. I've been trying to figure out where the problem might be myself, but without success.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
elseif ($_POST['1'] == x and $_POST['2'] == y and $_POST['3'] !== z or a)
{
$errors[] = 'Error';
}
It isn't functioning how I want it to. I want it to come up with an error message if post 3 does not equal 'z' or 'a'. However, it comes up with the error message regardless of whether post 3 is 'z' or 'a'. I've been trying to figure out where the problem might be myself, but without success.
Any help as always would be highly appreciated.
Many thanks
yep, as the guy posted above you can't use 'or' and 'and', or becomes '||' and and becomes '&&'