It looks like you're trying to select the correct option in an HTML element based on a value in PHP, but there are a couple of issues with your current code. Specifically, the $selected condition is not referencing the correct variable, and you're not comparing the correct value for selection.
Let's break it down:
Key issues: Wrong variable in the condition: You are checking $unit == $ssq1->unit_name, but $ssq1 is the result object of the query. You should use $resq1->unit_name instead, as this represents the current row data.
You should check the selected value against a variable: You likely want to compare the option's value to a variable like $unit, which should hold the value you want to be selected.