I have a MySQL query, that runs on user input.
How would I write an IF statement to see if a row is set?
I have tried:
if (!isset($row['example']) === true) {
//row not set
}
and:
if (empty($row['example'])) {
//row not set
}
Thanks!
***Edit: The first IF statement I tried actually did work. Sorry for any trouble I caused.
(!isset($row['example']) === true), it can be written as(!isset($row['example']))becauseisset()returns a boolean value. So writing!isset($var)will check ifisset()returns false.