View Full Version : [FAQ] Before posting An Error

Haunted Dawg
02-05-2009, 05:15 AM
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

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:


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 ;).

02-05-2009, 04:14 PM
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.

Haunted Dawg
02-05-2009, 04:18 PM
Because not everyone use's $db->query ;)

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

Haunted Dawg
03-02-2009, 05:34 PM
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.

03-02-2009, 06:04 PM
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!

03-02-2009, 10:31 PM
A method i use when having a weird error is to echo the sql strings, then test them in phpMyAdmin.

03-03-2009, 01:54 AM
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