Re: getting the options in a mysql enum
| From: | Chris Adams | Date: | Wed, 26 Jul 2000 18:31:05 +0000 |
| Subject: | Re: getting the options in a mysql enum | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-1535@lists.php.net to get a copy of this message | ||
> This query;
> $description = mysql_query("DESCRIBE boat_lines type;");
> echo (mysql_result($description, 0));
>
> just returns the name of the column, which in this case is type. I tried
> changing 0 to 1 but there is no row 1. When I make the same query in the
> mysql console, I get the correct description of the column. Any other
> suggestions?
That'd be column 1. The code I used looks something like this:
list(,$EthnicitiesDesc) = mysql_fetch_row(mysql_query("describe
members ethnicity"));
$Ethnicities = split("','", str_replace("')", "",
str_replace("set('",
"", $EthnicitiesDesc)));