q2a / question2answer

Question2Answer is a free and open source platform for Q&A sites, running on PHP/MySQL.
http://www.question2answer.org/
GNU General Public License v3.0
1.63k stars 628 forks source link

Db connection query failure params #890

Open Chepheus opened 3 years ago

Chepheus commented 3 years ago

Hello, sorry for my English I need this params to display whats wrong was in query.

svivian commented 3 years ago

Thanks for the PR. Could you explain a little more what this is for? The $params variable is not being used in your PR.

Chepheus commented 3 years ago

It is need for more detailed logs if inserting was failed. I create plugin for import array of data and I don't want to stop importing if one of element is broken (by default script stops). I need this params to understand whats wrong with my data without deep debugging.

Chepheus commented 3 years ago

About $params - I override default function to function qa_page_db_fail_handler($type, $errno = null, $error = null, $query = null, array $params = null)

Chepheus commented 3 years ago

What do you think about this PR? =)