Jump to content

enum output to a "select" value? Oo?


Recommended Posts

Well i think the title should say it all to be honest, i have a database with a table and a coble of rows in there. There is one of the rows that has "ENUM" as type and this "Højre" is default on the "ENUM" and has following options in it "Højre, Venstre".


Now my question is, what shall i do to make this enum work in a "<select>" html?


This is my code atm:

echo "<select name='info_side'>";	echo "<option value='0'>Vælg Genre</option>";	$info_side_query = "SELECT dsg_id_runner, dsg_info_side FROM dataskema_generator WHERE dsg_id_runner = $caller";	$info_side_result = $mysqli->query($info_side_query);	while ($row = $info_side_result->fetch_assoc())	{		echo "<option value='" .$row['dsg_info_side']."'>" .$row['dsg_info_side']."</option>";	}echo "</select>";

And yes i know the value in there should be numeric, but the insert HAS to be a "Højre, Venstre" string? Right Oo?


Hoping an answer soon ^^'

Thanks! :D

Edited by rootKID
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...