Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我不断得到一个PDO错误代码';00000和x27;在我的PHP中为我的insert语句_Php_Pdo_Insert Statement - Fatal编程技术网

我不断得到一个PDO错误代码';00000和x27;在我的PHP中为我的insert语句

我不断得到一个PDO错误代码';00000和x27;在我的PHP中为我的insert语句,php,pdo,insert-statement,Php,Pdo,Insert Statement,我一直收到PDO错误代码:00000 但是,当我var_转储语句并将其复制到MySQL工作台时,查询仍然有效。只是不适用于我的php页面 代码如下: if ($query->execute($bindValues)) { if ($query->rowCount()) { $changes =

我一直收到PDO错误代码:00000

但是,当我var_转储语句并将其复制到MySQL工作台时,查询仍然有效。只是不适用于我的php页面

代码如下:

if ($query->execute($bindValues))
                    {
                        if ($query->rowCount())
                        {
                            $changes = true;
                            /*
                            *   SET REG DATA TO SEND BACK
                            */
                            if (!$teamPermID)
                            {
                                $teamPermID = $pdoLink->lastInsertId();

                                if ($this->setTeamPermID($teamPermID))
                                {
                                    $_SESSION[$this->getEnvironment()]['Reg']['TeamRecord'][$typeOfTeam]['RegistrationInfo']['TeamPermID'] = $teamPermID;
                                    if (($teamRegistering) && (!$dbData['TeamPermIDSet']))
                                    {
                                        if ($typeOfTeam == 'club')
                                        {
                                            $dbData['TeamRegSQL'] .= " , ClubPermID = :teamPermID";
                                        }
                                        else if ($typeOfTeam == 'wogroup')
                                        {
                                            $dbData['TeamRegSQL'] .= " , WOGroupID = :teamPermID";  
                                        }
                                        $dbData['TeamRegBindValues'][":teamPermID"] = $teamPermID;
                                    }
                                }
                                else
                                {
                                    $_SESSION[$this->getEnvironment()]['Reg']['TeamRecord'][$typeOfTeam]['ErrorMessage'] = " Trouble sending information to database. No information has been saved. Please try again later 1.";
                                    return false;
                                }                                   
                            }
                            else
                            {
                                $_SESSION[$this->getEnvironment()]['Reg']['TeamRecord'][$typeOfTeam]['RegistrationInfo']['TeamPermID'] = $teamPermID;   
                            }
                        }
                    }
                    else
                    {
                        $_SESSION[$this->getEnvironment()]['Reg']['TeamRecord'][$typeOfTeam]['ErrorMessage'] = " Trouble sending information to database. No information has been saved. Please try again later 2-3" . $pdoLink->errorCode() . json_encode($pdoLink->errorInfo()) . $dbData['TeamSQL'] . json_encode($bindValues);
                        return false;
                    }
我尝试从以下位置更改查询:

if ($query->execute($bindValues))
致:

但每次都失败了。任何帮助都将不胜感激

输出的查询:

INSERT INTO Clubs 
SET DateAdded = "2017-09-26 21:06:54", 
LastModified = "2017-09-26 21:06:54", 
ModifiedBy = "0" , 
LMSCID = "14" , 
Year = "2017", 
ClubNumber = "145" , 
ClubID = "147-145" , 
ClubAbbr = "TNF" , 
ClubName = "Test New Fields" , 
ClubWebsite = "" ,
MemberCardImage = "" , 
ClubNotificationEmailAddress = "test@utesting.org" , 
ContactSwimmerID = "", 
ContactIsCoach = "0" , 
ContactFirstName = "Testing" , 
ContactLastName = "Test" , 
ContactAddress = "123 Street Rd" ,
CoachFirstName = "Fn" ,
CoachLastName = "Ln" ,
CoachSwimmerID = "34512" ,
ClubDescription = "" ,
ClubPracticeTimes = "", 
ClubFacebook = "" , 
ClubPhoto = "" , 
ContactCity = "Philadelphia", 
ContactStateAbbr = "PA" , 
ContactZip = "19038" , 
ContactPrimaryPhone = "(215) 555-6666" , 
ContactPrimaryPhoneContact = "0" , 
ContactSecondaryPhone = "0" , 
ContactSecondaryPhoneContact = "0" , 
ContactEmailAddress = "test@utesting.org" , 
ContactEmailAddressSecondary = ""

无法找出代码的错误。它在MySQL Workbench中执行良好

您能显示完整的查询吗?准备、绑定、执行?这是它的输出:请回答您的问题。不要在注释中插入代码。只需编辑并添加输出的代码。以下是一些相关阅读:您能显示完整的查询吗?准备、绑定、执行?这是它的输出:请回答您的问题。不要在注释中插入代码。只需编辑并添加输出的代码以下是一些相关阅读:
INSERT INTO Clubs 
SET DateAdded = "2017-09-26 21:06:54", 
LastModified = "2017-09-26 21:06:54", 
ModifiedBy = "0" , 
LMSCID = "14" , 
Year = "2017", 
ClubNumber = "145" , 
ClubID = "147-145" , 
ClubAbbr = "TNF" , 
ClubName = "Test New Fields" , 
ClubWebsite = "" ,
MemberCardImage = "" , 
ClubNotificationEmailAddress = "test@utesting.org" , 
ContactSwimmerID = "", 
ContactIsCoach = "0" , 
ContactFirstName = "Testing" , 
ContactLastName = "Test" , 
ContactAddress = "123 Street Rd" ,
CoachFirstName = "Fn" ,
CoachLastName = "Ln" ,
CoachSwimmerID = "34512" ,
ClubDescription = "" ,
ClubPracticeTimes = "", 
ClubFacebook = "" , 
ClubPhoto = "" , 
ContactCity = "Philadelphia", 
ContactStateAbbr = "PA" , 
ContactZip = "19038" , 
ContactPrimaryPhone = "(215) 555-6666" , 
ContactPrimaryPhoneContact = "0" , 
ContactSecondaryPhone = "0" , 
ContactSecondaryPhoneContact = "0" , 
ContactEmailAddress = "test@utesting.org" , 
ContactEmailAddressSecondary = ""