is there a simple way to pull ENUM values and show all of them?
I have 4 values; but this looks like it could get easier, especially when I want to list ENUM values
Can I somehow while pulling information, put them as REFERENCES already??? Besides now I have only 4; if I was to add another ENUM value; I would have to redo the code in all places where needed...
Please help....thank you...
$query = "SHOW COLUMNS FROM jpms LIKE 'kategoria' ";
$result=mysql_query($query);
if(mysql_num_rows($result)>0){
$row=mysql_fetch_row($result);
$options=explode("','",preg_replace("/(enum|set)\('(.+?)'\)/","\\2",$row[1]));
}
echo "<a href='produkty.php?produkt=$options[0]'>$options[0]</a><BR>
<a href='produkty.php?produkt=$options[1]'>$options[1]</a><BR>
<a href='produkty.php?produkt=$options[2]'>$options[2]</a><BR>
<a href='produkty.php?produkt=$options[3]'>$options[3]</a>";