Haunted Dawg Posted February 5, 2009 Share Posted February 5, 2009 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: 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 ;). Quote Link to comment Share on other sites More sharing options...
POG1 Posted February 5, 2009 Share Posted February 5, 2009 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. Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted February 5, 2009 Author Share Posted February 5, 2009 Re: [FAQ] Before posting An Error Because not everyone use's $db->query ;) I normaly use or print(mysql_error().' on line '.__LINE__.die()); Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted March 2, 2009 Author Share Posted March 2, 2009 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. Quote Link to comment Share on other sites More sharing options...
Floydian Posted March 2, 2009 Share Posted March 2, 2009 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! Quote Link to comment Share on other sites More sharing options...
POG1 Posted March 2, 2009 Share Posted March 2, 2009 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. Quote Link to comment Share on other sites More sharing options...
Floydian Posted March 3, 2009 Share Posted March 3, 2009 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.