1

I have the following script that I use for part of my count in payment_status from Mysql. I have seen some examples of this online, but I can't seem to figure out how to make this work WITH a Null instance. Any insight would be appreciated.

Note: The way I have it now doesn't work when Null is in the database. I'm guessing because that isn't an inserted word?

Objective: To add $row['payment_status'] == "Null" to this with the rest of the script.

if($row['payment_status'] == "Completed" || $row['payment_status'] == "Free" || $row['payment_status'] == "Cancelled" || $row['payment_status'] == "Null")
1
  • NULL means? default value in payment_status column? if Yes then check without double quote null Commented Sep 1, 2022 at 6:02

1 Answer 1

1

if payment_status column has default value NULL, Then try below change

if($row['payment_status'] == "Completed" || $row['payment_status'] == "Free" || $row['payment_status'] == "Cancelled" || $row['payment_status'] == null)
Sign up to request clarification or add additional context in comments.

1 Comment

Ahhhh yes that did the trick. Thank you. I see why now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.