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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:51:32+00:00 2026-05-23T02:51:32+00:00

Suppose I want to display the sql error in log file which has been

  • 0

Suppose I want to display the sql error in log file which has been created by me. For example ,error log file called “myerror.log “

Now i am using the following code to print my message in log file , ” error_log(mysql_error(), 3, “tmp/myerror.log”); “.
So Every time when message is printed in myerror.log file with same line, Here i want to print the message one after another.

Kindly help me
Thanks
Dinesh Kumar Manoharan

  • 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-23T02:51:33+00:00Added an answer on May 23, 2026 at 2:51 am

    As I understand you want to have each entry/message on new line. If so:

    error_log(mysql_error() . PHP_EOL, 3, "tmp/myerror.log");
    

    If you want to have timestamp as well, you will have to add it yourself:

    $dt = date('Y-m-d H:i:s', time());
    error_log("[{$dt}] " . mysql_error() . PHP_EOL, 3, "tmp/myerror.log");
    

    If you need to constantly use such formatting I recommend to create your own function (something like this):

    define('MY_ERROR_LOG', 'tmp/myerror.log');
    
    function myErrorLog($message)
    {
        $dt = date('Y-m-d H:i:s', time());
        error_log("[{$dt}] " . $message . PHP_EOL, 3, MY_ERROR_LOG);
    }
    // use it
    myErrorLog(mysql_error());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose you have a JTable and for each cell you want to display three
Suppose I want to open a file in an existing Emacs session using su
Suppose I want to execute code, for example value += 5 inside a namespace
Suppose I want to make a Web application which uses a fixed width and
I want to display a certain message on a certain page. Suppose the name
Suppose I have a Site.Master page. I want to display something like the version
Suppose there is a frame with some image.I want to display only those parts
Suppose I want to set the display property of a div to inline-block. In
For example, suppose I want to detect the color of the pixel with screen
i have a scollview and i want to display suppose 10 images. frame width

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.