I am creating a form with JSN Uniform
in which I have a dropdown that must be filled with values from a database, I have dealt with several videos but I have not achieved results.
How can I fill my dropdown of JSN umiform with data from my BD?
Is it okay to write the script code when the form is displayed?
$conexion=mysql_connect('localhost', 'estefani','3st3f4n1') or die ("No se puede conectar".mysql_error());
mysql_select_db("letritastv", $conexion) or die ("No se puede conectar".mysql_error());
$sentencia= mysql_query("SELECT nameimg FROM a_t3s1s_image ORDER BY nameimg ASC");
$query=mysql_query($sentencia);
while ($arreglo=mysql_fetch_array($query))
{
echo "<option value=' ".$arreglo['codigo']." ' ";
if($_POST['4']==$arreglo ['codigo'])
echo " SELECTED ";
echo ">";
echo $arreglo['4']; ------> **se supone que 4 es el nombre del dropdown**
echo "</option>";
}