0
        <?php     function createLead($CuFirst, $CuLast, $COBool, $COFirst, $COLast, $CuAddrs1,
    $CuAddrs2, $CuCity, $CuZip, $CuEmail, $CuDphone, $CuHphone, $CuCphone, $BuildYr, $HoAge, $NoWindows,
    $NoWindowQuote, $WindowType1, $WindowType2, $WindowType3, $WindowType4, $GlassType1, $GlassType2,
    $Doors1, $Doors2, $Doors3, $Doors4, $Issue1, $Issue2, $Issue3, $Issue4, $Issue5, $Issue6, $Issue6,
    $Issue7, $Event, $Staff, $DigiSign, $Comments) {
        $CreateLead = "INSERT INTO  'rbaevent'.'leadentry' ('CuLast','CuFirst','COBool','COFirst','COLast','CuAddrs1','CuAddrs2','City','Zip','Email',
'DPhone','HPhone','CPhone','Built','AgeWindows','NoWindows','NoWinQuote','Aluminium','Vinyl',
'Wood','Clad','Single','Double','Entry','Patio','French','None','Cost','Cold','Clean',
'Fogging','Hard','Rotting','Peeling','Secure','Event','selectname','DigiSign','Comments')
 VALUES ('$CuFirst', '$CuLast','$COBool', '$COFirst', '$COLast', '$CuAddrs1', '$CuAddrs2',
'$CuCity', '$CuZip', '$CuEmail','$CuDphone', '$CuHphone', '$CuCphone', '$BuildYr', '$HoAge',
'$NoWindows', '$NoWindowQuote','$WindowType1', '$WindowType2', '$WindowType3', '$WindowType4',
'$GlassType1', '$GlassType2','$Doors1', '$Doors2', '$Doors3', '$Doors4', '$Issue1', '$Issue2',
'$Issue3', '$Issue4', '$Issue5','$Issue6', '$Issue6', '$Issue7',  '$Event', '$Staff',
'$DigiSign' ,'$Comments')";
         return $CreateLead; }

这是错误消息:

您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在 ''leadentry'('CuLast', 'CuFirst', 'COBool', 'COFirst', 'COLast', 'CuAddrs1', 'CuA' at 1号线

4

2 回答 2

3

在 SQL 查询中指向表时不能使用这些引号

INTO  'rbaevent'.'leadentry' (

应该

INTO  `rbaevent`.`leadentry` (
于 2013-02-16T09:34:52.960 回答
1

将您的代码更改为:您使用了错误的 '' 您必须使用键盘上 TAB 按钮上方的 ``

  function createLead($CuFirst, $CuLast, $COBool, $COFirst, $COLast, $CuAddrs1,     $CuAddrs2, $CuCity, $CuZip, $CuEmail, $CuDphone, $CuHphone, $CuCphone, $BuildYr, $HoAge, $NoWindows, $NoWindowQuote, $WindowType1, $WindowType2, $WindowType3, $WindowType4, $GlassType1, $GlassType2, $Doors1, $Doors2, $Doors3, $Doors4, $Issue1, $Issue2, $Issue3, $Issue4, $Issue5, $Issue6, $Issue6, $Issue7, $Event, $Staff, $DigiSign, $Comments) {
     $CreateLead = "INSERT INTO  `rbaevent`.`leadentry` (
      `CuLast`,
      `CuFirst`,
      `COBool`,
      `COFirst`,
      `COLast`,
      `CuAddrs1`,
      `CuAddrs2`,
      `City`,
      `Zip`,
      `Email`,
      `DPhone`,
      `HPhone`,
      `CPhone`,
      `Built`,
      `AgeWindows`,
      `NoWindows`,
      `NoWinQuote`,
      `Aluminium`,
      `Vinyl`,
      `Wood`,
      `Clad`,
      `Single`,
      `Double`,
      `Entry`,
      `Patio`,
      `French`,
      `None`,
      `Cost`,
      `Cold`,
      `Clean`,
      `Fogging`,
      `Hard`,
      `Rotting`,
      `Peeling`,
      `Secure`, 
      `Event`, 
      `selectname`,
      `DigiSign`,
       `Comments`)
    VALUES ('$CuFirst', '$CuLast', '$COBool', '$COFirst', '$COLast', '$CuAddrs1', '$CuAddrs2', '$CuCity', '$CuZip', '$CuEmail', '$CuDphone', '$CuHphone', '$CuCphone', '$BuildYr', '$HoAge', '$NoWindows', '$NoWindowQuote', '$WindowType1', '$WindowType2', '$WindowType3', '$WindowType4', '$GlassType1', '$GlassType2', '$Doors1', '$Doors2', '$Doors3', '$Doors4', '$Issue1', '$Issue2', '$Issue3', '$Issue4', '$Issue5', '$Issue6', '$Issue6', '$Issue7',  '$Event', '$Staff', '$DigiSign' ,'$Comments')";
  return $CreateLead;
 }

就是这样!

于 2013-02-16T09:39:50.557 回答