I keep getting PDO error code: 00000
When I var_dump the statement and copy it into MySQL Workbench the query works however. Just doesn't work with my php page.
The code is below:
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;
                    }
I tried changing the query from:
if ($query->execute($bindValues))
To:
if ($query->execute($bindValues) === true)
and it still fails every time. Any help would be GREATLY appreciated.
Outputted query:
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 = "[email protected]" , 
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 = "[email protected]" , 
ContactEmailAddressSecondary = ""
Can't figure out what is wrong with the code. It executes fine in MySQL Workbench