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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:34:37+00:00 2026-06-02T09:34:37+00:00

When there is an error with your sql statement in codeigniter you get a

  • 0

When there is an error with your sql statement in codeigniter you get a message a bit like this:-

 A Database Error Occurred

Error Number: 1096

- some sql -

Filename: \system\database\DB_driver.php

Line Number: 334

Which is all well and good but when you’ve got lots of statements running for a single page it would help to know which line of code generated the query.

How do I get name of the model and method (or the filename) which generated the query?

  • 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-02T09:34:55+00:00Added an answer on June 2, 2026 at 9:34 am

    I’m answering my own question here because I found a quick and dirty solution which works for debugging purposes. I highly recommend leaving CI system files in tact, this should only be used for debugging. I might write an extension for CI to do this when I’ve got time.

    Solution for CI 2:-

    Go and edit system\database\DB_driver.php and add the following code on line 321:-

    echo "<pre>";
    debug_print_backtrace();
    echo "</pre>";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get an exception with the message: There is an error in XML document.
Hi Is there any error in this TRIGGER Statement.When ever i try to run
When debugging in Visual Studio 2008 I get the error There is no source
When we try to create a view within a funcion we get ERROR: there
Recently I came across this error in my WCF trace: There was an error
What is wrong with this statement? It works with sqlite and MS sql (last
Hi there here is my SQL insert statement: $customeraddress_query = INSERT INTO `customer_address` (
Are there any free solutions for automatically migrating a database from MySQL to SQL
is there something that I'm missing? Thanks :) Error SQL query: ALTER TABLE `venues`
Error msg: You have an error in your SQL syntax; check the manual that

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.