Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6236027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:46:45+00:00 2026-05-24T10:46:45+00:00

I have been converting my sql code to PHP PDO, and so far I

  • 0

I have been converting my sql code to PHP PDO, and so far I have had two issues. both giving the save error

Warning: PDOStatement::execute() [pdostatement.execute]: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1', `admin_active` = '0' WHERE `id` = '1' AND `agency_id` = '1' LIMIT 1' at line 1 in ....

This is my code:

    $sql  = "UPDATE `tblAgencyLocations` ";
    $sql .= "SET `location_name` = :LocationName, `address1` = :Address1, `address2` = :Address2, ";
    $sql .= "`city` = :City, `state` = :State, `zip_code` = :ZipCode, `phone1` = :Phone1, ";
    $sql .= "`phone2` = :Phone2, `fax1` = :Fax1, `email_address` = ':EmailAddress, ";
    $sql .= "`admin_active` = :LocationActive ";
    $sql .= "WHERE `id` = :AgencyLocationID AND `agency_id` = :agencyID LIMIT 1";

    $STH = $this->prepare($sql);
    $STH->bindParam(':agencyID', $agencyID);
    $STH->bindParam(':LocationName', $LocationName);
    $STH->bindParam(':Address1', $Address1);
    $STH->bindParam(':Address2', $Address2);
    $STH->bindParam(':City', $City);
    $STH->bindParam(':State', $State);
    $STH->bindParam(':ZipCode', $ZipCode);
    $STH->bindParam(':Phone1', $Phone1);
    $STH->bindParam(':Phone2', $Phone2);
    $STH->bindParam(':Fax1', $Fax1);
    $STH->bindParam(':EmailAddress', $EmailAddress);
    $STH->bindParam(':LocationActive', $LocationActive);
    $STH->bindParam(':AgencyLocationID', $AgencyLocationID);
    $STH->execute();

I got this same error, the other one was a select. Is there a limitation on how many times you can “Bind”? or the SQL is very long?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T10:46:46+00:00Added an answer on May 24, 2026 at 10:46 am

    The lone quotation mark is causing a syntax error here:

    `email_address` = ':EmailAddress
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been tasked with converting several php classes into java classes, which is
I have been using the mysql api in PHP, and am now converting to
I have been tasked with converting a SQL Server database into a MySQL 5.*
I have been using the following code for months (without problem) in a .NET
I have a php application that has about 50-55 code files. The file that
Up until yesterday I have been happily connecting to SQL Server Express 2005 using
I have been looking around for examples related to converting JSON strings to Java
Have been looking at the MVC storefront and see that IQueryable is returned from
Have been studying the file system related classes of Adobe AIR 1.5, but so
We have been using CruiseControl for quite a while with NUnit and NAnt. For

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.