I have a custom piece of MySQL that works on every WordPress system I have seen so far, but fails on one customer system.
I didn't write this, so am working out what it means.
The problem is that it fails to connect to the MySQL database, (or it connects, but gets no data).
What diagnostic should I use to chase this down?
global $db_pdo,$wpdb;
$sql= "Select * from ".$wpdb->prefix."posts where post_type = :post_type";
$order_status = $db_pdo->prepare($sql);
$data=array(':post_type' => 'shop_order');
$order_status->execute($data);