I want to know how this if condition can be true if $_GET['song_genre'] is not equal to bangla or, hindi, or, english.
Since you are using loose comparison (==
) instead of strict comparison (===
) the values will type juggle, so a 0 would be true:
var_dump(0 == "bangla"); // bool(true)
But since anything in $_GET
will always be a string or an array, there should be no practical way to get the if clause to evaluate to true with anything but the three strings. Nevertheless, use strict comparison.
On a side note: please use prepared statements to guard against sql injection.