这是我的代码:
mysql_query("INSERT INTO jokes (headline, text, type) VALUES ('{$_POST['headline']}','{$_POST['text']}', '{$_POST['type']}')") or die(mysql_error());
我想发布一个选择选项,如
<select name="type">
<option value="regular">regular joke</option>
<option value="other">other</option>
</select>
这是我的理论,但它不起作用(它没有出现在数据库中,我有一个常规和其他的枚举字段)。有什么帮助吗?
编辑:没关系,我将枚举更改为 varchar,现在它可以工作了:)