Advanced Search

Results 1 to 4 of 4

Thread: disabling mysql_connect error message

  1. #1
    Join Date
    Aug 2013
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default disabling mysql_connect error message

    please i need to know how to disable mysql_connect error message in php while am rewriting the codes to PDO.

    some suggest

    1: adding @ at the begining of the connection. as follow

    @mysql_connect

    2: removing the or die() functions

    3: setting DEBUG_MODE = 2 in every php file and in php.ini.

    source is below

    http://help.x-cart.com/index.php?tit...ing_debug_mode

    what do i do

    Thank you

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,629
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    You should not disable the error messages. If you are getting an error message, it means there is an error. Errors are for fixing, not ignoring.

    1. The @ (error suppression operator) is intended to allow you to build your own error handling procedures, not to allow you to ignore errors.

    2. ... or die() construct is acceptable for debugging, but it is not good error handling. In this case, however, it's not what you're looking for anyway. It doesn't suppress or fix errors: quite the opposite, it stops the script dead in its tracks.

    3. DEBUG_MODE is not a core php.ini directive for error handling, so I don't know what it does. Whoever recommended it most likely assumed you were using a particular debugging tool/extension that uses this setting.

    If you share the particular error message you are getting, we can help you troubleshoot and solve the problem.
    Last edited by traq; 02-14-2014 at 09:33 PM.
    We Only Torture the Folks We Don't Like (You're Probably Gonna Be Okay)
    It's a Party in the CIA

  3. #3
    Join Date
    Aug 2013
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You are right Traq.

    Thank You

  4. #4
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,629
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Need help with it?
    We Only Torture the Folks We Don't Like (You're Probably Gonna Be Okay)
    It's a Party in the CIA

Similar Threads

  1. Difference between mysql_pconnect() and mysql_connect()
    By letom in forum MySQL and other databases
    Replies: 1
    Last Post: 11-15-2013, 05:13 PM
  2. Error Message in 3d spinning message
    By drgsb in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 05-24-2009, 06:36 AM
  3. Replies: 1
    Last Post: 05-15-2008, 04:31 PM
  4. Disabling Friendly HTTP Error Messages
    By ryersondg in forum PHP
    Replies: 1
    Last Post: 02-23-2008, 04:12 AM
  5. Replies: 4
    Last Post: 09-28-2007, 09:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •