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?