Have the following php query:
if ($result = mysqli_query($conn, "SELECT scholarship1, scholarship2, scholarship3, scholarship4, scholarship5, scholarship6, scholarship7, scholarship8, scholarship9, scholarship10, date1, date2, date3, date4, date4, date5, date6, date7, date8, date9, date10 FROM scholarships")) {
$row_cnt = mysqli_num_rows($result);
if (($row_cnt) > 0) {
while(mysqli_fetch_assoc($result)) {
if ((['scholarship4'] == null) AND (['scholarship3'] != null)) {
echo "YES";
}
else {
echo "NO";
}
}
}
}
Connection to the database was successful.
$row_cnt > 0
recognizing data in database.
My if statement returns "NO" when 'scholarship4' is clearly NULL and 'scholarship3' clearly has data.
I essentially copied this code from another of my pages that was working properly, so I am flabbergasted as to what is going on here.
One thing I did remove was while($row = ...)
since the original data input was not of the 'select' variety. Also, please keep in mind, this is just testing the if statement initially, whereas many if statements are currently hidden from the loop.
Please let me know if more information is needed. Thanks for any and all help.
When you fetch the data, you need to store it and then reference this array in your test...