Forum Moderators: coopster

Message Too Old, No Replies

Multi select checkbox into ENUM

ENUM back to Multi select checkbox

         

Gruessle

7:14 am on Feb 19, 2005 (gmt 0)

10+ Year Member




Two questions!

1)How do I make this work?

My db looks like this (other values)
enum('','1','2','3')

if ($submit) {
$enom-table = implode(",", $GValue);

<form met....

<input type="checkbox" name="GValue[]" value="1">
<input type="checkbox" name="GValue[]" value="2">
<input type="checkbox" name="GValue[]" value="3">

</form>

2) How do I reverse it, meaning follwing funktion but with checkbox and not Select?
<option value="<?php echo $Ethnicity?>"><?php echo $Ethnicity?></option>

hakre

7:19 am on Feb 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



to get enum [dev.mysql.com] "reverse engineered" use SHOW COLUMNS FROM tbl_name LIKE enum_col and parse the ENUM definition in the second column of the output - that's all. don't forget that mysql will automatically add NULL (value=NULL) and '' (value='') to your enum definition.

Gruessle

10:31 pm on Feb 19, 2005 (gmt 0)

10+ Year Member



I will try that but first I need to figure out how ro get multi selections in to an ENUM.