0

I'm currently working on a website using Wordpress and everything had been working fine until now but now I need to get some information from a custom database on Strato.de but whenever the page tries to get the information, all I get is POST domain.com/wp-admin/admin-ajax.php 400

Here is the code I use to retrieve the data:

function get_project_data_func($atts){
    $mydb = new wpdb($username, $password, $database, $servername);
    $rows = $mydb->get_results("SELECT * FROM projects p WHERE p.id = 1");
    $obj = $rows[0];
    echo "<p>".$obj->title."</p>";
}
add_shortcode('get_project_data', 'get_project_data_func'); 

Could anyone tell me why this error occurs and how I can fix it?

Clemens U
  • 3
  • 1
  • 4
  • The error indicates an issue with the data the client sent - see answers to the duplicate question. You need to check the data sent to figure out what went wrong. – Shadow Jul 12 '21 at 10:38

0 Answers0