Skip to content
Advertisement

SELECT query IF CONDITION

I have one problem with my SELECT query in my blog page.

I want comment count of each blog when comment status=1.

I am apply following query..

but it giving SYNTAX ERROR..

Please tell me where I am wrong.

Thanks

Advertisement

Answer

If statement contains three expressions. First, the expression, second the value returned if condition is true and third if condition is false so you are missing the third expression. Try the below code

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement