Adding a list to an input field in a Form (populates with PHP)

Does anyone have a way of adding a list (eg list=“mylist”) to a field in a form?
I’m trying to populate a field with php and can create the datalist but cannot add the data list to the field.

I’m populating the field with a PHP Snippet which blocs identifies and everything works but the Code Editor keeps changing the ‘>’ symbol in the SQL script to the &gt equivalent. Is there anyway to avoid this as the query string has to be manually edited after exporting otherwise it fails.