It seems there’s something wrong with this. I don’t get any distinct errors, but it’s simply not doing what its supposed to be doing. I’m leaning towards there being a problem with the OR statements, but I’ve put the username in parenth, and the id slots in parenth, and neither work. Honestly, i’m only posting this here because five hours of looking at it got to be enough for me.
Hopefully something looks blatantly wrong and it’s not somewhere else in the code :/
$fetch_userone_idslots = mysql_query("SELECT id_1, id_2, id_3, id_4, id_5, id_6 FROM users WHERE id_1 = '$battle_id' || id_2 = '$battle_id || id_3 = '$battle_id || id_4 = '$battle_id || id_5 = '$battle_id || id_6 = '$battle_id && username == '$user_logged_in'");
while ($row = mysql_fetch_array($fetch_userone_idslots)){
$useroneidslot_1 = $row['id_1'];
$useroneidslot_2 = $row['id_2'];
$useroneidslot_3 = $row['id_3'];
$useroneidslot_4 = $row['id_4'];
$useroneidslot_5 = $row['id_5'];
$useroneidslot_6 = $row['id_6'];
}
You are using a
==which does not exist in MySQL. Use just=. You can simplify your query like this