How do you get ALL the values from SQL columns if an 'if' statement is correct? Here is an example by what I mean:
TABLE:
|__ID__|__MadeBy__|__Username__|__Completed__|
| 1 | user1 | user14 | TrueYes |
| 2 | user7 | user14 | TrueYes |
| 3 | NONE | user18 | FalseNo |
| 4 | user25 | user1234 | TrueYes |
| 5 | NONE | user1234 | FalseNo |
What I want is to loop through the 'Completed' column and if there is a value, where it says FalseNo, then print other values from the SAME row, but not from all columns.
Example:
If Completed value = FalseNo, then print ID and Username from the same row.
Since there are more rows containing FalseNo values in the Completed column, display them also.
Example:
The program prints:
ID: 3
Username: user18
ID: 5
Username: user1234
What I tried doing is this:
<?php
//Coinflips Table
#Select the completed column
$selectCompleted = $mysqli->query("SELECT * FROM coinflips WHERE completed='FalseNo'");
#Get the row associated with the value
$getJoinableList = $selectCompleted->fetch_array(MYSQLI_ASSOC);
#Get the row's value of a column
$getJoinableBetCompleted = $getJoinableList['completed'];
$getJoinableBetID = $getJoinableList['id'];
$getJoinableBetUsername = $getJoinableList['username'];
if($getJoinableBetCompleted == "FalseNo") {
echo "ID:" . $getJoinableBetID;
echo "Username" . $getJoinableBetUsername;
}
?>
But this just crashes the website.
Thank you in advance, Laurynas :)