I am trying to achieve the following: I ask my SQL database a query using SELECT * FROM subjects
. After doing that I ask for the array using mysqli_fetch_asso
In if
statement you should use double equal sign: if (a == b)
Your comparison operator is wrong. You're using =
which is an assignment operator. In your example it will always be true. You need to use ==
which is a comparison operator.
if ($subject["sexo"] = 1) {
should be
if ($subject["sexo"] == 1) {