Hi
How can I output the executing code's linenumber?
regards tores
Print current line of code?
Moderator: General Moderators
Code: Select all
<?php
echo "a";
trigger_error("");
echo "b";
?>- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
the inbuilt variables __LINE__, and __FILE__ can be used for debugging. For instance:
Debugging can also be helped by switching on php debugging...
finally if all else fails try running php at the command line level.
Code: Select all
if (db_result_count==0) {
die ('Database failure at '.basename(__FILE__).': Line'.__LINE__.'> Illegal SQL result';
}Code: Select all
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
Last edited by CoderGoblin on Mon Aug 09, 2004 6:03 am, edited 1 time in total.