存储信息故障

时间:2018-11-27 17:06:21

标签: php mysql insert

我正在尝试获取此表单以将信息发送到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语法有错误;在第57行SQL查询中,检查与您的MySQL服务器版本相对应的手册,以在'NULL,NULL,0,NULL,NULL,NULL,NULL,'附近使用正确的语法SQL查询:插入rss_settings(campid,{ {1}},fromnamefromurlredirecttourlredirect_url_after_unsubscribesetunsubscribelinkreporttoadminadmin_email,{{1 }},display_rssopt_in_typedbl_opt_redirectdbl_opt_subdbl_opt_bodystop_mailrss_subsmax_mail_limitnext_camp_nameauto_removerequire_poppop_serverpop_emailidpop_passwordsubs_thru_mailsubs_emailid,{ {1}},subs_subjectunsubs_thru_mailunsubs_emailidunsubs_subjectmsg_formateblock_ip_listblock_semail_list,{{1 }},block_domain_listblock_pemail_listfield_last_nameblocked_redirect_urlcall_apiproduct_numberallow_rewardsnumber_signupdownload_linkreferral_email_subjectreferral_url_emailreward_email_subjectreward_emailallow_vistors_rewardmultiple_vistors_rewardnumbers_of_visits,{ {1}})值(1,'360 Tee Times','360teetimes@360teetimes.com','https://360teetimes.com/emails/thanks.php','https://360teetimes.com/emails/unsubscribe.php',NULL,NULL,'facebookleads@360teetimes.com' ,NULL,'Double','https://360teetimes.com/lead_page/index.php','您的下载已准备就绪','#Name#请从下面的链接下载您的书。#VerifyLink#考虑Mark A. Lockwood',NULL,NULL,0 ,'第一次销售',NULL,'N',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'text',NULL,NULL,NULL,NULL,'on',NULL,NULL, NULL,'否',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL NU LL,NULL,0,NULL,NULL,NULL,NULL,NULL)

我对此还很陌生,仍然在学习,因此欢迎任何指点。

1 个答案:

答案 0 :(得分:0)

您在结尾的第8列和第9列之间缺少逗号。

   \/                  
NULL NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL )
   /\
相关问题