I have a problem. I would like to create drop down list with options that are selected from my mysql database. And i have problem becouse when i try it this way my page is like "Error 500".`
$filmsar = array();
$vare = 0;
$result_films = mysql_query("SELECT `film_name` FROM `films`");
while($row_film = mysql_fetch_assoc($result_films))
{
$filmsar[$vare]=$row_film["film_name"];
$vare++;
}
This is how i load my data. And now this is how i'm trying to create drop down list:
Jaki film:<br>
<select name="film_id_name">'
for($i = 0; $i<$vare;$i++){
'<option>'.$filmsar[i].'</option>'}'
<option>Tu wpisz pierwszą możliwość</option>
<option>Tu wpisz drugą możliwość</option>
</select>
I would be greatful for any help.
50* Errors are server errors, so u should search for errors in ur server side language (PHP in this scenerio).
In this case i would wonder if u're using old enough version of php to use mysql_query (since it's depracated from PHP 5.5).
Instead of this, learn how to use PDO.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.