I’m working on an older script. Someone told me that the script uses ancient way of debugging (file and line).
I’ve posted an example of the script. What should I be using instead of the FILE and LINE method?
mysql class –
function error($file, $line) {
trigger_error("DB error in *<b>{$file}</b>* on line <b>{$line}</b><br />\n " . mysql_error() . "" . @mysql_error($this->dbl), E_USER_ERROR);
}
function query($query, $file, $line) {
$result = mysql_query($query) or $this->error($file, $line);
$this->num_queries++;
return $result;
}
Standard query –
$DB->query("SELECT * FROM table"), __FILE__, __LINE__);
Realistically, you should be using
debug_backtracefor this.Eg: