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 8591271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:29:17+00:00 2026-06-11T23:29:17+00:00

Why does the following statement fail in php (I have an established PDO connection

  • 0

Why does the following statement fail in php (I have an established PDO connection to sqlite database named config.db).

$stmt = $this->db->prepare("INSERT INTO config (S_BASE_DIR) VALUES (':col0')");
$stmt->bindParam(':col0',$colValue);
$stmt->execute();
$stmt->close();

The exact error is:

Fatal error: Uncaught exception ‘PDOException’ with message
‘SQLSTATE[HY000]: General error: 25 bind or column index out of range’

  • 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-06-11T23:29:18+00:00Added an answer on June 11, 2026 at 11:29 pm

    When binding to a column, you do not need to quote the column:

    $stmt = $this->db->prepare( "INSERT INTO config (S_BASE_DIR) VALUES ( :col0 )" );
    $stmt->bindParam(':col0', $colValue);
    

    With quotes around the :col0 it is just a string, and not a binding parameter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can any one explain me what does following statement means? I have found this
In the following SQL statement, SQLite sorts correctly but MySQL does not: However, if
I have the following statement: vsnprintf(target, size - 1, %ls_%ls, str16_1, str16_2); Why does
Why does the following code fail to compile, while changing the case statement to
Why does the following statement return true ? "608E-4234" == "272E-3063" I have also
Does the following include statement present a security risk? include pages/.$_GET[page]..php; If yes: -
Does the following statement holds for any double (Java primitive double precision IEEE-754) except
What does the following Javascript statement do to a ? a >>>= b;
(XCode 4.3) Why does the following crash at the NSLog statement with EXC_BAD_ACCESS? BOOL
I'm getting crazy with this IE 7... ==> hhttp://neu.emergent-innovation.com/ Why does following function not

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.