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! Link to comment https://forums.phpfreaks.com/topic/39261-solved-determining-the-line-of-code/ 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__; Link to comment https://forums.phpfreaks.com/topic/39261-solved-determining-the-line-of-code/#findComment-189183 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! Link to comment https://forums.phpfreaks.com/topic/39261-solved-determining-the-line-of-code/#findComment-189187 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.