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

  • Home
  • SEARCH
  • 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 4244866
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:45:52+00:00 2026-05-21T03:45:52+00:00

I am getting this mysql error You have an error in your SQL syntax;

  • 0

I am getting this mysql error

“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 ‘AND (
XYZField = 5)’ at line 1 “

This error doesnt give information about mysql error occured location , i mean filename, function and line number.Is there any way to retrieve this info?

  • 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-21T03:45:53+00:00Added an answer on May 21, 2026 at 3:45 am

    You can do. You have to create you own error handler. This will require a extra code from your side.

    For an example:-

    Assuming you are using mysql_ family function and PHP

    When you invoke any query you have to handle these mysql errors and can pass some of the variable containing function, file name info to customize errors.

    Look at the debug-backtrace function of PHP this will give you what you needed. The current line number, file name function name, class name.

    You can get data from this function and pass them into the trigger_error along with mysql_error() function

      mysql_query('SELECT ....') or trigger_error(mysql_error().' in the file 
    '.$filename.' with function'.$function_name)
    

    This is just a direction you can do even better from this.

    EDIT AFTER THE OP COMMENT

    You have customized database class

    function db_error($query, mysql_errno(), mysql_error())
    {
       $info=debug_backtrace();
       //This return array containing file name, line number function name etc
       //your rest code to display errors
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

You have an error in your SQL syntax; check the manual that corresponds to
I am getting this error now that I hit version number 1.256.0: Error 4
Ok, when trying to insert into the database I'm getting this error You have
I am getting the following from the mysql_error(): You have an error in your
I'm getting a syntax error on this PHP code: <snip> $last = (isset($_GET['last']) &&
Anyone getting this error when using the new free chart controls MS bought from
I'm getting this problem: PHP Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable
I am getting this error when trying to run internet information services on a
I am getting this error but only very occasionally. 99.9% of the time it
I'm getting this error on a compact framework form. code generation for property 'inputControl'

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.