gpt4 book ai didi

php - 如何在 PHP 中获取枚举的默认值?

转载 作者:行者123 更新时间:2023-11-29 01:18:54 25 4
gpt4 key购买 nike

如何在 PHP/MySQL 中获取枚举的默认值?我希望将其用作单选按钮/下拉菜单。

最佳答案

mysql> create table choices ( choice enum('a','b') not null default 'b');Query OK, 0 rows affected (0.00 sec)mysql> desc choices;+--------+---------------+------+-----+---------+-------+| Field  | Type          | Null | Key | Default | Extra |+--------+---------------+------+-----+---------+-------+| choice | enum('a','b') | NO   |     | b       |       |+--------+---------------+------+-----+---------+-------+mysql> show columns from choices like 'choice';+--------+---------------+------+-----+---------+-------+| Field  | Type          | Null | Key | Default | Extra |+--------+---------------+------+-----+---------+-------+| choice | enum('a','b') | NO   |     | b       |       |+--------+---------------+------+-----+---------+-------+

任一查询都可以在 Default 字段上产生结果

关于php - 如何在 PHP 中获取枚举的默认值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4624081/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com