MySQL error reporting

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul Furman

    #1

    MySQL error reporting

    How do I turn off MySQL error reporting? I set error_reporting (0); but
    that doesn't seem to be working.
  • Jerry Stuckle

    #2
    Re: MySQL error reporting

    Paul Furman wrote:
    How do I turn off MySQL error reporting? I set error_reporting (0); but
    that doesn't seem to be working.
    That turns off PHP error reporting.

    What problem are you having?

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • Paul Furman

      #3
      Re: MySQL error reporting

      Jerry Stuckle wrote:
      Paul Furman wrote:
      >
      >How do I turn off MySQL error reporting? I set error_reporting (0); but
      >that doesn't seem to be working.
      >
      That turns off PHP error reporting.
      >
      What problem are you having?
      Sorry for the slow reply. Any SQL error appears on the screen, and
      sometimes that includes info I don't want included. Hmm, now that I
      think of it that may be a built in error reporting system (I didn't
      write all of this system). In any case is this a risk and is there a way
      of turning it off? The worst case I recall was something like:

      ERROR: unable to connect to the sever using user 'admin' and password
      'mysectretpassw ord'

      Ha ha, I made that up as I don't recall that one but I don't want
      anything like that to happen again!

      Comment

      • Jerry Stuckle

        #4
        Re: MySQL error reporting

        Paul Furman wrote:
        Jerry Stuckle wrote:
        >Paul Furman wrote:
        >>
        >>How do I turn off MySQL error reporting? I set error_reporting (0);
        >>but that doesn't seem to be working.
        >>
        >That turns off PHP error reporting.
        >>
        >What problem are you having?
        >
        Sorry for the slow reply. Any SQL error appears on the screen, and
        sometimes that includes info I don't want included. Hmm, now that I
        think of it that may be a built in error reporting system (I didn't
        write all of this system). In any case is this a risk and is there a way
        of turning it off? The worst case I recall was something like:
        >
        ERROR: unable to connect to the sever using user 'admin' and password
        'mysectretpassw ord'
        >
        Ha ha, I made that up as I don't recall that one but I don't want
        anything like that to happen again!
        Preface the mysql_connect() call with an '@' character, i.e.

        @mysql_connect( ....);

        This suppresses any error message for this function. Just be sure to
        check the response.

        --
        =============== ===
        Remove the "x" from my email address
        Jerry Stuckle
        JDS Computer Training Corp.
        jstucklex@attgl obal.net
        =============== ===

        Comment

        • Paul Furman

          #5
          Re: MySQL error reporting

          Jerry Stuckle wrote:
          Paul Furman wrote:
          >
          >Jerry Stuckle wrote:
          >>
          >>Paul Furman wrote:
          >>>
          >>>How do I turn off MySQL error reporting? I set error_reporting (0);
          >>>but that doesn't seem to be working.
          >>>
          >>>
          >>That turns off PHP error reporting.
          >>>
          >>What problem are you having?
          >>
          >>
          >Sorry for the slow reply. Any SQL error appears on the screen, and
          >sometimes that includes info I don't want included. Hmm, now that I
          >think of it that may be a built in error reporting system (I didn't
          >write all of this system). In any case is this a risk and is there a
          >way of turning it off? The worst case I recall was something like:
          >>
          >ERROR: unable to connect to the sever using user 'admin' and password
          >'mysectretpass word'
          >>
          >Ha ha, I made that up as I don't recall that one but I don't want
          >anything like that to happen again!
          >
          >
          Preface the mysql_connect() call with an '@' character, i.e.
          >
          @mysql_connect( ....);
          >
          This suppresses any error message for this function. Just be sure to
          check the response.
          >
          Excellent, thank you!!!

          Comment

          • Paul Furman

            #6
            Re: MySQL error reporting

            Paul Furman wrote:
            Jerry Stuckle wrote:
            >Paul Furman wrote:
            >>Jerry Stuckle wrote:
            >>>Paul Furman wrote:
            >>>>
            >>>>How do I turn off MySQL error reporting? I set error_reporting (0);
            >>>>but that doesn't seem to be working.
            >>>>
            >>>That turns off PHP error reporting.
            >>>>
            >>>What problem are you having?
            >>>
            >>Sorry for the slow reply. Any SQL error appears on the screen, and
            >>sometimes that includes info I don't want included. Hmm, now that I
            >>think of it that may be a built in error reporting system (I didn't
            >>write all of this system). In any case is this a risk and is there a
            >>way of turning it off? The worst case I recall was something like:
            >>>
            >>ERROR: unable to connect to the sever using user 'admin' and password
            >>'mysectretpas sword'
            >>>
            >>Ha ha, I made that up as I don't recall that one but I don't want
            >>anything like that to happen again!
            >>
            >Preface the mysql_connect() call with an '@' character, i.e.
            >>
            > @mysql_connect( ....);
            >>
            >This suppresses any error message for this function. Just be sure to
            >check the response.
            >
            Excellent, thank you!!!
            Hmm, well I thought that was working but maybe just on the live server
            not my home test version. Anyways I have a related question. Now I do
            want to show at least part of the error, to prevent duplicate login
            names, I set the 'unique' key on that field and tested, the test came
            back like this *first section in red I'd like to show* the next part I'd
            rather not:

            --
            *ERROR: Duplicate entry 'paul' for key 2* - INSERT INTO customer VALUES
            (0, 'paul','paul', '', 'paul', 'p', '', '', '', 'CA', '', '',
            '2007-04-24', 'no', '0', 'n', 'n', 'n' )

            Thank you! Your registration has been completed!
            --

            And of course I'd want at a minimum to be able to note the error &
            suppress my "thank you" message afterwards. That bit of code is simply:

            query($query);
            print "<p>Thank you! Your registration has been completed!</p>\n";

            more like this:

            query($query);
            if (!$error){
            print "<p>Thank you! Your registration has been completed!</p>\n";
            }

            Thanks for any ideas!

            Paul



            Comment

            • Steve

              #7
              Re: MySQL error reporting

              | And of course I'd want at a minimum to be able to note the error &
              | suppress my "thank you" message afterwards. That bit of code is simply:
              |
              | query($query);
              | print "<p>Thank you! Your registration has been completed!</p>\n";
              |
              | more like this:
              |
              | query($query);
              | if (!$error){
              | print "<p>Thank you! Your registration has been completed!</p>\n";
              | }

              have you tried something like:

              if (@query($query) !== false)
              {
              //thanks
              } else {
              // handle the error
              }


              Comment

              • Jerry Stuckle

                #8
                Re: MySQL error reporting

                Paul Furman wrote:
                Paul Furman wrote:
                >Jerry Stuckle wrote:
                >>Paul Furman wrote:
                >>>Jerry Stuckle wrote:
                >>>>Paul Furman wrote:
                >>>>>
                >>>>>How do I turn off MySQL error reporting? I set error_reporting (0);
                >>>>>but that doesn't seem to be working.
                >>>>>
                >>>>That turns off PHP error reporting.
                >>>>>
                >>>>What problem are you having?
                >>>>
                >>>Sorry for the slow reply. Any SQL error appears on the screen, and
                >>>sometimes that includes info I don't want included. Hmm, now that I
                >>>think of it that may be a built in error reporting system (I didn't
                >>>write all of this system). In any case is this a risk and is there a
                >>>way of turning it off? The worst case I recall was something like:
                >>>>
                >>>ERROR: unable to connect to the sever using user 'admin' and
                >>>password 'mysectretpassw ord'
                >>>>
                >>>Ha ha, I made that up as I don't recall that one but I don't want
                >>>anything like that to happen again!
                >>>
                >>Preface the mysql_connect() call with an '@' character, i.e.
                >>>
                >> @mysql_connect( ....);
                >>>
                >>This suppresses any error message for this function. Just be sure to
                >>check the response.
                >>
                >Excellent, thank you!!!
                >
                Hmm, well I thought that was working but maybe just on the live server
                not my home test version. Anyways I have a related question. Now I do
                want to show at least part of the error, to prevent duplicate login
                names, I set the 'unique' key on that field and tested, the test came
                back like this *first section in red I'd like to show* the next part I'd
                rather not:
                >
                --
                *ERROR: Duplicate entry 'paul' for key 2* - INSERT INTO customer VALUES
                (0, 'paul','paul', '', 'paul', 'p', '', '', '', 'CA', '', '',
                '2007-04-24', 'no', '0', 'n', 'n', 'n' )
                >
                Thank you! Your registration has been completed!
                --
                >
                And of course I'd want at a minimum to be able to note the error &
                suppress my "thank you" message afterwards. That bit of code is simply:
                >
                query($query);
                print "<p>Thank you! Your registration has been completed!</p>\n";
                >
                more like this:
                >
                query($query);
                if (!$error){
                print "<p>Thank you! Your registration has been completed!</p>\n";
                }
                >
                Thanks for any ideas!
                >
                Paul
                >
                >
                >
                Paul,

                Not as easy - and a little bit user unfriendly, also.

                Rather - check the result of the @mysql_query() insert. If it is false,
                call mysql_errno() to get the error number.

                Error code 1062 is a duplicate entry error. If you get that, the userid
                already exists. If you get something else, you have a different problem.


                --
                =============== ===
                Remove the "x" from my email address
                Jerry Stuckle
                JDS Computer Training Corp.
                jstucklex@attgl obal.net
                =============== ===

                Comment

                • Paul Furman

                  #9
                  Re: MySQL error reporting

                  Thanks!

                  Jerry Stuckle wrote:
                  Paul Furman wrote:
                  >
                  >Paul Furman wrote:
                  >>
                  >>Jerry Stuckle wrote:
                  >>>
                  >>>Paul Furman wrote:
                  >>>>
                  >>>>Jerry Stuckle wrote:
                  >>>>>
                  >>>>>Paul Furman wrote:
                  >>>>>>
                  >>>>>>How do I turn off MySQL error reporting? I set
                  >>>>>>error_rep orting(0); but that doesn't seem to be working.
                  >>>>>>
                  >>>>>>
                  >>>>>That turns off PHP error reporting.
                  >>>>>>
                  >>>>>What problem are you having?
                  >>>>>
                  >>>>>
                  >>>>Sorry for the slow reply. Any SQL error appears on the screen, and
                  >>>>sometimes that includes info I don't want included. Hmm, now that I
                  >>>>think of it that may be a built in error reporting system (I didn't
                  >>>>write all of this system). In any case is this a risk and is there
                  >>>>a way of turning it off? The worst case I recall was something like:
                  >>>>>
                  >>>>ERROR: unable to connect to the sever using user 'admin' and
                  >>>>password 'mysectretpassw ord'
                  >>>>>
                  >>>>Ha ha, I made that up as I don't recall that one but I don't want
                  >>>>anything like that to happen again!
                  >>>>
                  >>>>
                  >>>Preface the mysql_connect() call with an '@' character, i.e.
                  >>>>
                  >>> @mysql_connect( ....);
                  >>>>
                  >>>This suppresses any error message for this function. Just be sure
                  >>>to check the response.
                  >>>
                  >>>
                  >>Excellent, thank you!!!
                  >>
                  >>
                  >Hmm, well I thought that was working but maybe just on the live server
                  >not my home test version. Anyways I have a related question. Now I do
                  >want to show at least part of the error, to prevent duplicate login
                  >names, I set the 'unique' key on that field and tested, the test came
                  >back like this *first section in red I'd like to show* the next part
                  >I'd rather not:
                  >>
                  >--
                  >*ERROR: Duplicate entry 'paul' for key 2* - INSERT INTO customer
                  >VALUES (0, 'paul','paul', '', 'paul', 'p', '', '', '', 'CA', '', '',
                  >'2007-04-24', 'no', '0', 'n', 'n', 'n' )
                  >>
                  >Thank you! Your registration has been completed!
                  >--
                  >>
                  >And of course I'd want at a minimum to be able to note the error &
                  >suppress my "thank you" message afterwards. That bit of code is simply:
                  >>
                  >query($query );
                  >print "<p>Thank you! Your registration has been completed!</p>\n";
                  >>
                  >more like this:
                  >>
                  >query($query );
                  >if (!$error){
                  > print "<p>Thank you! Your registration has been completed!</p>\n";
                  >}
                  >>
                  >Thanks for any ideas!
                  >>
                  >Paul
                  >>
                  >>
                  >>
                  >
                  Paul,
                  >
                  Not as easy - and a little bit user unfriendly, also.
                  >
                  Rather - check the result of the @mysql_query() insert. If it is false,
                  call mysql_errno() to get the error number.
                  >
                  Error code 1062 is a duplicate entry error. If you get that, the userid
                  already exists. If you get something else, you have a different problem.
                  >
                  >

                  --
                  Paul Furman Photography
                  http://www.edgehill.net/1
                  Bay Natives Nursery
                  http://www.baynatives.com

                  Comment

                  Working...