Jump to content

clean alternative to mysql_query('...')or trigger_error(mysql_error(),256);


daydreamer

Recommended Posts

I am currently using my own error handler so i can log all mysql errors into a mysql table:

mysql_query('select data from table')or trigger_error(mysql_error(),256);

 

If there's an error i need to know the line number where the mysql_query function was called.

 

Is it possible to instead use this code:

mysql_query('select data from table');

 

but somehow transparently log a mysql error and the line number if there is an error in the query?

 

thanks

 

 

 

That page is helpful, i am aware of __LINE__, but the problem is I would need to know the line number where the function was called without passing __LINE__ as a argument.

 

e.g.

function mysql_query(){//override mysql_query
        mysql_query()or error_function(error_code,error_string,line_number);
}


mysql_query(); //<<< need to log this line number

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.