gpt4 book ai didi

php - 如何将具有共享名称的字段值插入MySQL?

转载 作者:行者123 更新时间:2023-11-30 01:07:32 25 4
gpt4 key购买 nike

我有一些具有共享名称的字段。

我想插入有数据(或值)的那个。使用 jquery show 和 hide 一次仅显示一个具有共享名称的字段。

我尝试在每个字段中使名称相同,如下所示:

mailer_type

我尝试将其设为数组,如下所示:

mailer_type[]

我尝试将其设为数组,如下所示:

mailer_type[mt]

为了获取帖子数据,我尝试了以下方法:

$mailer_type = mysql_real_escape_string(htmlspecialchars($_POST['mailer_type']));

为了获取帖子数据,我尝试了以下方法:

$mailer_type = mysql_real_escape_string(htmlspecialchars($_POST['mailer_type[]']));

为了获取帖子数据,我尝试了以下方法:

$mailer_type = mysql_real_escape_string(htmlspecialchars($_POST['mailer_type[mt]']));

为了获取帖子数据,我尝试了以下方法:

$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。该字段的实际值没有被插入。

最佳答案

试试这个:

$mailer_type = mysql_real_escape_string(htmlspecialchars($_REQUEST['mailer_type']));

不是发布,而是查看是否获取发布数据。

关于php - 如何将具有共享名称的字段值插入MySQL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19637917/

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