php - 存储信息故障
问题描述
我正在尝试获取此表单以将信息发送到 MySQL DB。数据库总是发出错误。我一直在尝试找出问题所在,但似乎无法找到问题所在。因为我是一个相对新手,可能与这个问题有很大关系。页面向数据库发送信息的代码是
<?php
error_reporting(E_ALL);
require_once('commoninclude.php');
session_start();
///session check
if(!(isset($_SESSION["admin"]) && $_SESSION["admin"] != ""))
{
header("Location:index.php");
}
$smarty = new Smarty();
if((isset($_SESSION['campaignid'])) && ($_SESSION['campaignid']!=""))
$newcampid=$_SESSION['campaignid'];
else
$newcampid="";
if( (isset($_SESSION['campid']) )&& ($_SESSION['campid']!=""))
{
$rowcamp= Show_Campaign($_SESSION['campid']);
}
if((isset($_REQUEST['view']))&& ($_REQUEST['view']!=""))
{
$excampid=$rowcamp[0];
$mesid=Update_Campaign_Messages($excampid);
$setingid=Update_Campaign_Settings($excampid);
$subscriberid=Update_Campaign_Subscribers($excampid);
$_SESSION['showcampid']="";
unset($_SESSION['showcampid']);
$_SESSION['editcamp']="no";
}
else if( (isset($_SESSION['edit']))&& ($_SESSION['edit']!=""))
{
$_SESSION['showcampid']="";
unset($_SESSION['showcampid']);
$_SESSION['editcampaignid']=$rowcamp[0];
$_SESSION['editcampaignname']=$rowcamp[1];
$_SESSION['editcamp']="yes";
}
if( (isset($_SESSION['editcampaignid'])) && ($_SESSION['editcampaignid']!=""))
{
$newcampid=$_SESSION['editcampaignid'];
$_SESSION['campaignid']=$newcampid;
}
else if( (isset($_SESSION['campaignid'])) && ($_SESSION['campaignid']!=""))
{
$newcampid=$_SESSION['campaignid'];
}
////coding for save settings
if(isset($_POST['txtsetfromname']))
{
$var=$_POST['auto_remove'];
$count_list=count($var);
if($count_list!=0)
{
$auto_remove=implode(",", $var);
}
else
{
$auto_remove="";
}
$setid= Update_Setting($_POST['txtsetfromname'],$_POST['txtsetfromemail'],$_POST['txtredirect'],
$_POST['txtredirect_unsubscribe'],$_POST['chkaddsublink'],$_POST['chkreporttoadmin'],
$_POST['settingid'],$_POST['txtadminmail'],$_POST['chkrssfeed'],$_POST['optintype'],
$_POST['dbl_opt_red_url'],$_POST['dbl_opt_subject'],$_POST['dbl_opt_matter'],
$_POST['chkstopmail'],$_POST['rss_subs'],$_POST['max_mail_limit'],
$_POST['next_camp_name'],$auto_remove,$_POST['require_pop'],$_POST['pop_server'],
$_POST['pop_emailid'],$_POST['pop_password'],$_POST['subs_thru_mail'],$_POST['subs_emailid'],
$_POST['subs_subject'],$_POST['unsubs_thru_mail'],$_POST['unsubs_emailid'],$_POST['unsubs_subject'],$_POST['msg_formate'],
$_POST['hd_block_ip_list'],$_POST['hd_block_semail_list'],$_POST['hd_block_domain_list'],
$_POST['hd_block_pemail_list'],
$_POST['field_last_name'],$_POST['blocked_redirect_url'],$_POST['call_api'],$_POST['product_number'],
$_POST['allow_rewards'],$_POST['number_signup'],$_POST['download_link'],
$_POST['referral_email_subject'],$_POST['referral_url_email'],
$_POST['reward_email_subject'],$_POST['reward_email'],
$_POST['allow_multiple_rewards'],$_POST['download_link_2'],$_POST['download_link_3'],
$_POST['allow_vistors_reward'],$_POST['multiple_vistors_reward'],
$_POST['numbers_of_visits'],$_POST['visit_reward1'],$_POST['visit_reward2'],
$_POST['visit_reward3'],$_POST['vistors_email_subject'],$_POST['vistors_reward_email']
);
else
$setid=Save_Settings($_POST['txtsetfromname'],$_POST['txtsetfromemail'],$_POST['txtredirect'],
$_POST['txtredirect_unsubscribe'],$_POST['chkaddsublink'],$_POST['chkreporttoadmin'],
$_POST['txtadminmail'],$_POST['chkrssfeed'],$_POST['optintype'],$_POST['dbl_opt_red_url'],
$_POST['dbl_opt_subject'],$_POST['dbl_opt_matter'],$_POST['chkstopmail'],
$_POST['rss_subs'],$_POST['max_mail_limit'], $_POST['next_camp_name'],$auto_remove,
$_POST['require_pop'],$_POST['pop_server'], $_POST['pop_emailid'],
$_POST['pop_password'],$_POST['subs_thru_mail'],$_POST['subs_emailid'],
$_POST['subs_subject'],$_POST['unsubs_thru_mail'],$_POST['unsubs_emailid'],$_POST['unsubs_subject'],$_POST['msg_formate'],
$_POST['hd_block_ip_list'],$_POST['hd_block_semail_list'],$_POST['hd_block_domain_list'],
$_POST['hd_block_pemail_list'],$_POST['field_last_name'],$_POST['blocked_redirect_url'],$_POST['call_api'],$_POST['product_number'],
$_POST['allow_rewards'],$_POST['number_signup'],$_POST['download_link'],
$_POST['referral_email_subject'],$_POST['referral_url_email'],
$_POST['reward_email_subject'],$_POST['reward_email'],
$_POST['allow_multiple_rewards'],$_POST['download_link_2'],$_POST['download_link_3'],
$_POST['allow_vistors_reward'],$_POST['multiple_vistors_reward'],
$_POST['numbers_of_visits'],$_POST['visit_reward1'],$_POST['visit_reward2'],
$_POST['visit_reward3'],$_POST['vistors_email_subject'],$_POST['vistors_reward_email']
); if(isset($_POST['settingid']) && ($_POST['settingid']!=""))
}
require_once('show.all.php');
if((isset($_REQUEST['savesetting'])) && ($_REQUEST['savesetting']!="") )
{
$smarty->assign("saved","true");
}
else
{
$smarty->assign("saved", "");
}
$newcampid=$_SESSION['campaignid'];
$camp_name=getNameByCamnpId($_SESSION['campid']);
$custom_fields=GetAllCustomFields($_SESSION['campid']);
$tracking_links=GetAllTracking_links($_SESSION['campid']);
$All_group=GetAllGroupName($_SESSION['campid']);
$campaign_list=Show_Selected_Campaign($_SESSION['campid']);
$smarty->assign("camp_name",$camp_name);
$smarty->assign("newcampid",$newcampid);
$smarty->assign("custom_fields",$custom_fields);
$smarty->assign("tracking_links",$tracking_links);
$smarty->assign("All_group",$All_group);
$smarty->assign("campaign_list",$campaign_list);
require_once('../include/menu.php');
$smarty->assign("url","campaign.php");
$smarty->assign("setting","settings.php?sec=savesetting");
$smarty->assign("message","message.php");
$smarty->assign("date","message.php");
$smarty->assign("subscriber","subscribers.php");
$smarty->display("settings.main.tpl.html");
// $RedirectTo = "showcamp.php?campid=".$newcampid;
// if (isset($_SERVER['QUERY_STRING']))
// {
// $RedirectTo .= (strpos($RedirectTo, '?')) ? "&" : "?";
// $RedirectTo .= $_SERVER['QUERY_STRING'];
//}
//sheader(sprintf("Location: %s", $RedirectTo));
require_once('richtext.php');
?>
错误代码如下。
您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 57 行的 'NULL, NULL, 0, NULL, NULL, NULL, NULL, ' 附近使用正确的语法 SQL 查询:插入 rss_settings (
campid
,fromname
,fromurl
,redirecttourl
,redirect_url_after_unsubscribe
,setunsubscribelink
,reporttoadmin
,admin_email
,display_rss
,opt_in_type
,dbl_opt_redirect
,dbl_opt_sub
,dbl_opt_body
,stop_mail
,rss_subs
,max_mail_limit
,next_camp_name
,auto_remove
,require_pop
,pop_server
,pop_emailid
,pop_password
,subs_thru_mail
,subs_emailid
,subs_subject
,unsubs_thru_mail
,unsubs_emailid
, ,unsubs_subject
,msg_formate
,block_ip_list
,block_semail_list
,block_domain_list
,block_pemail_list
,field_last_name
,blocked_redirect_url
,call_api
,product_number
,allow_rewards
,number_signup
,download_link
,referral_email_subject
,referral_url_email
reward_email_subject
,reward_email
,allow_vistors_reward
,multiple_vistors_reward
,numbers_of_visits
,visit_reward1
,visit_reward2
,visit_reward3
,vistors_email_subject
,vistors_reward_email
) VALUES(1, 'somewhere', 'somewhere@somewhere.com', 'https://somewhere.com/emails/thanks.php', 'https://somewhere.com /emails/unsubscribe.php', NULL, NULL, 'facebookleads@somewhere.com', NULL, 'Double', 'https://somewhere.com/lead_page/index.php', '你的下载准备好了', ' #Name# 请从下面的链接下载您的书。#VerifyLink# Regards someone', NULL, NULL, 0, '1st Sale', NULL, 'N', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL,'文本',NULL,NULL,NULL,NULL,'on',NULL,NULL,NULL,'否',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL NULL,NULL , 0, 空值, 空值, 空值, 空值, 空值)
我对此很陌生,仍在学习,所以欢迎任何指点。
解决方案
您在最后的第 8 列和第 9 列之间缺少逗号。
\/
NULL NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL )
/\
推荐阅读
- javascript - 我们如何使表单将提交的信息发送到电子邮件
- javascript - 如何计算圆周上两点之间的坐标点x,y(内圆)?
- python - 数据框:跨列的笛卡尔积
- c++ - 通知 cv 时 condition_variable::wait_for 是否返回 true
- spring-boot - 如何在单元测试中停止和启动嵌入式 Kafka?
- c++ - FLTK - Mac iOS 图像未显示
- python - Django 使用哪些模板加载器?
- python - 在绘图的某处绘制带有 url 的 pandas 图表
- python-3.x - 在 python2.7 和 python3.X 中使用 numba-scipy 扩展计算 cdist 时出错
- informatica - taget 的数据库级别和 Informatica 级别的数据类型不匹配