存储信息故障

dphi5xsq  于 2021-06-17  发布在  Mysql
关注(0)|答案(1)|浏览(287)

我试图让这个表单发送信息到mysql数据库。db总是发出错误。我一直在努力找出问题所在,但似乎找不到问题所在。因为我是一个相对的新手,这可能与这个问题有很大关系。将信息发送到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 query:insert into rss\u settings中,检查与您的mysql服务器版本对应的手册,以获得使用“null,null,0,null,null,null,null,null”附近的正确语法( 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 )值(1,'某处','somewhere@somewhere.com', 'https://somewhere.com/emails/thanks.php', 'https://somewhere.com/emails/unsubscribe.php',空,空,'facebookleads@somewhere.com',null,'双精度','https://somewhere.com/lead_page/index.php','您的下载已准备就绪','姓名#请从下面的链接下载您的书#verifylink#问候某人',null,null,0,'1st sale',null,'n',null,null,null,null,null,null,null,null,'text',null,null,null,null,null,null,'no',0,null,null,null,null,null,null,null,null,null,0,null,null,null,null,null,null)
我对这一点还很陌生,而且还在学习,所以欢迎任何指点。

iqjalb3h

iqjalb3h1#

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

\/                  
NULL NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL )
   /\

相关问题