That's exactly what the code I gave you does...
This ternary basically says if $row[1] == 1, then set the value of $chekstatus to CHECKED, otherwise, set $checkstatus to "".
$checkstatus = ($row[1] == 1) ? " CHECKED" : "";
Then you just echo your checkbox:
echo "<input type=\"checkbox\" name=\"checkbox\" value=\"".$row[0]."\"".$checkstatus." />";
So, if the ternary resulted in $checkstatus to being set to CHECKED, the checkbox will be set. Check if out by setting $row[1] to 1 (hardset it) and then hardset it to something else. You'll see it works.
The ternary is just a condensed If/Else, because as you can see, you only have to echo the checkbox once. If you want a conventional If/Else, then it would look something like this:
If($row[1] == 1) {
$checkstatus = " CHECKED";
} else {
$checkstatus = "";
}
echo "<input type=\"checkbox\" name=\"checkbox\" value=\"".$row[0]."\"".$checkstatus." />";
The function is exactly the same.