php - how to check for wordpress Query errors

admin2025-01-08  6

In mysql or mysqli you can add this type of Query:

<?php

    $sql = mysqli_query($con, Insert into database itt (name) VALUES ($name)") or die(mysqli_error($con));

?>

What does wordpress do for this?

Or how does the code look?

Does it look like the code above?

In mysql or mysqli you can add this type of Query:

<?php

    $sql = mysqli_query($con, Insert into database itt (name) VALUES ($name)") or die(mysqli_error($con));

?>

What does wordpress do for this?

Or how does the code look?

Does it look like the code above?

Share Improve this question asked Dec 8, 2014 at 1:57 Mike DawnMike Dawn 1 2
  • You might want to try a debugging plugin wordpress.org/plugins/search.php?q=debug+database&sort= – iyrin Commented Dec 8, 2014 at 3:26
  • The Query Monitor plugin looks like the one you are seeking wordpress.org/plugins/query-monitor – iyrin Commented Dec 8, 2014 at 3:31
Add a comment  | 

2 Answers 2

Reset to default 0

A good pointer would be to enable debugging in WordPress. Add this to your wp-config.php: define( 'WP_DEBUG', true );.

By default WordPress does not show much debug information. More on this here.

You can install this plugin, Debug Bar, it is not only query, you can also debug more information.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736269367a1346.html

最新回复(0)