bobleny Posted February 20, 2007 Share Posted February 20, 2007 Is there a way to determine the line a piece of code is on? This is a little difficult to explain.... I've sorta worked out an error system.... UH.. Did I loose you yet? This is script will tell me if the query fails. If I am not the one who gets the error message, then I won't know about the problem.... if(!$query) { $_SESSION['error_message'] = mysql_error(); $_SESSION['error_location'] = "Page: " . $page . " - Line: 249"; mysql_close(); sendem(error, .1); die(); } You will notice the "Line: 249". Well, as I edit the page and add new things the line that it is on will not be accurate. I need a variable of some sort that will tell me what line it is on, with out me constantly changing the number. Do you understand yet? I hope so... So, how can I do this? Thanks! Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 20, 2007 Share Posted February 20, 2007 http://us2.php.net/manual/en/language.constants.predefined.php $_SESSION['error_location'] = "Page: " . $page . " - Line: ".__LINE__; Quote Link to comment Share on other sites More sharing options...
bobleny Posted February 20, 2007 Author Share Posted February 20, 2007 Lol, that sounds hard! God, I was expecting some long complex function.... This is cool. Thanks! 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.