Rakesh K
Rakesh K

Reputation: 712

Drupal 7 - How can we debug SQL query errors

I am new to Drupal, and while interacting with database sometimes I get this error:

Error
The website encountered an unexpected error. Please try again later.

How do I debug this issue? How can I can see which and what query is causing the issue?

Upvotes: 0

Views: 187

Answers (1)

Bustikiller
Bustikiller

Reputation: 2508

Have a look at Drupal Devel Module. After enabling it, in the config page (Admin > Configuration > Development > Development Options) you should check the first option.

Checkbox that should be selected (sorry, mine is in Spanish!)

Then, you will see a list of queries to the database every time you load a page. The time needed to perform the query is also shown. This way you can identify which queries have a bad performance.

Hope it helps

Upvotes: 1

Related Questions