Using if-else in JSP

It’s almost always advisable to not use scriptlets in your JSP. They’re considered bad form. Instead, try using JSTL (JSP Standard Tag Library) combined with EL (Expression Language) to run the conditional logic you’re trying to do. As an added benefit, JSTL also includes other important features like looping. Instead of: Use: Also, unless you plan on using response.jsp … Read more

if else construction

There are several errors in your code. And you should use a cond when dealing with multiple conditions (think of it as a series of IF/ELSE IF/…/ELSE statements). Be aware that the expression (and (> x 1) (= x 1)) will never be true, as x is either greater than or equal to 1, both … Read more

PHP if not statements

Your logic is slightly off. The second || should be &&: You can see why your original line fails by trying out a sample value. Let’s say $action is “delete”. Here’s how the condition reduces down step by step: Oops! The condition just succeeded and printed “error”, but it was supposed to fail. In fact, … Read more

extended initializer lists only available with

This style of initialisation, using braces: was introduced to the language in 2011. Older compilers don’t support it; some newer ones (like yours) only support it if you tell them; for your compiler: However, this form of initialisation still isn’t valid for arrays created with new. Since it’s small and only used locally, you could … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)