Announcement

Collapse
No announcement yet.

[FAQ] Before posting An Error

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [FAQ] Before posting An Error

    I have made this topic for you people before you post an error and hopefully everyone read's it and it help's them.

    When it come's to mysql error's add

    PHP Code:
    or die(mysql_error().' on line '.__LINE__); 
    That will indicate the mysql error and on what line it is on.

    Second. When getting a php error. Take your code into notepad++ or any code highlighter program you got. And look where the colour coding goes wrong.

    Thirdly. When something is not displaying add this to the top of your page:

    PHP Code:
    error_reporting(E_ALL);
    ini_set('error_reporting',1); 
    That might help you to find your error.

    And to my last one. 4th.

    If none of the above resulted in fixing your code. Post it to us. Don't post it among the mod's but inside the help board. People will actualy start to help you out.

    Also when posting your error. Post about 5 - 15 lines up and 5 - 15 lines down from your error. If you post the hole code and the code is of 300+ line's people will ignore it and move on.

    If you want help you got to help us also.

    By that i mean. Don't make it hard for us to find your error.

    I hope some of you follow this guideline to when posting a error.


    And if this is in the wrong section. Admin feel free to move it .

  • #2
    Re: [FAQ] Before posting An Error

    or die() isn't the best idea..

    Why not just edit the standard class to show an error for staff and a totally different 1 for non staff.
    Save space!!! post your source code at
    http://postsource.net

    Comment


    • #3
      Re: [FAQ] Before posting An Error

      Because not everyone use's $db->query

      I normaly use or print(mysql_error().' on line '.__LINE__.die());

      Comment


      • #4
        Re: [FAQ] Before posting An Error

        Can anyone please use this before posting error's. It saves us atleast time.

        This is only because i have had around 6 people on msn asking me about SQL error's.

        Comment


        • #5
          Re: [FAQ] Before posting An Error

          It's true the "or die" method isn't the best.

          It's also true that using the "or die" method is a lot better than not using any mysql debugging at all.


          Nice topic Haunted Dawg. If people follow this, it will be very helpful for them indeed!
          Need a mod for your game? I do work that is second to none. PM me for further details or click on my banner to view my website.

          Comment


          • #6
            Re: [FAQ] Before posting An Error

            A method i use when having a weird error is to echo the sql strings, then test them in phpMyAdmin.
            Save space!!! post your source code at
            http://postsource.net

            Comment


            • #7
              Re: [FAQ] Before posting An Error

              That's a good one to do as well POG1.

              I find MySQL Administrator/Query Browser to be especially useful for that sort of thing. Although, if you're on a shared server, you might not be able to get access to a remote MySQL connection
              Need a mod for your game? I do work that is second to none. PM me for further details or click on my banner to view my website.

              Comment

              Working...
              X