Saturday, December 22, 2018

How to display db results as options in HTML dropdown with PHP and Mysqli?




I am trying to to let users choose the state filed from a drop down in the form, but although the query works, the DB is connected, the drop down does not display the list.



Not sure if relevant but i'm running Windows Server, IIS 10 and the latest PHP and MySql.















I expect the list from the DB to be in the dropdown, but it is empty (No dropdown list).


Answer



delete your first



$row1 = mysqli_fetch_array($result1);


line &
put your two variables(result & row1) in var_dump to get debug


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...