Chris Morgan : Pass database link handle to database error retrieval functions so we retrieve the error from the correct database connection . Add explicit link handle to query_error() and remove the option to not specify an error.