0
while($row_list=pg_fetch_assoc($list)){
    echo '<option' if(isset($_SESSION['hoopSelect'])){ echo 'selected="'$_SESSION['hoopSelect']'"'; } ' value='. $row_list['username'] . '>' . $row_list['username'] . '</option>';}

I want to have my while loop continue working while if $_SESSION['hoopSelect'] is set to 'small' for example, reloading the page it will pre-select the option. It runs perfectly without if(isset($_SESSION['hoopSelect'])){ echo 'selected="'$_SESSION['hoopSelect']'"'; } '

I get an error page 500 when i add this, i wonder if i am placing it in the wrong location, or if i have strcutured it incorrectly, thanks for any input.

E Hughes
  • 3
  • 1
  • You need to use concatenation. For example, `echo ' – Jay Blanchard Apr 30 '20 at 14:16
  • Hi E. Could you please format your code properly? It would help us identify a potential problem more easily. Also, a 500 status code means an internal server error, which most likely means a syntax error in your code. – Romi Halasz Apr 30 '20 at 14:16
  • Hi Jay, I believe you are right, i've played around with concatenation on this line of code for hours, to confirm are you telling me echo ' – E Hughes Apr 30 '20 at 14:22

0 Answers0