我有几个具有共享名称的字段。
我想插入任何一个有数据(或值)的数据。通过jquery显示和隐藏,一次只显示一个具有共享名称的字段。
我尝试在每个字段中使用相同的名称,如下所示:
mailer_type我试着让它变成这样的数组:
mailer_type[]我试着让它变成这样的数组:
mailer_type[mt]为了获取post数据,我尝试了以下命令:
$mailer_type = mysql_real_escape_string(htmlspecialchars($_POST['mailer_type']));为了获取post数据,我尝试了以下命令:
$mailer_type = mysql_real_escape_string(htmlspecialchars($_POST['mailer_type[]']));为了获取post数据,我尝试了以下命令:
$mailer_type = mysql_real_escape_string(htmlspecialchars($_POST['mailer_type[mt]']));为了获取post数据,我尝试了以下命令:
$mailer_type = mysql_real_escape_string(htmlspecialchars($_POST['mailer_type']['mt']));将数据插入到数据库中总是相同的。没有尝试过不同的东西:
mysql_query("INSERT jobs SET mailer_type='$mailer_type' ") or die(mysql_error());每次提交表单时,表列中要么没有任何内容,要么表列中出现0。未插入该字段的实际值。
发布于 2013-10-28 22:54:30
试试这个:
$mailer_type = mysql_real_escape_string(htmlspecialchars($_REQUEST['mailer_type']));
而不是post,看看它是否获得post数据。
https://stackoverflow.com/questions/19637917
复制相似问题