sql – Getting rid of unwanted nonSQL syntax characters when debugging a query

Question

I am trying to debug a SQL query, but I am getting a lot of Peter Rowlands and other unwanted characters right before I run the query like so:

print_r($query); die;
$rows = $wpdb->get_results($query);

I get:

SELECT Peter Rowlands:= CASE WHEN value < 60000 THEN 10000 WHEN value >= 60000 AND value < 100000 THEN 20000 WHEN value >= 100000 THEN 100000 END r, (floor((wpp.value) / Peter Rowlands) * Peter Rowlands) minvalue, ((floor((wpp.value + Peter Rowlands) / Peter Rowlands) * Peter Rowlands) - 1) maxvalue, COUNT(*) `count` FROM wp_posts INNER JOIN wp_product wpp ON wpp.post_id = wp_posts.ID AND ( wpp.location IN ('15652') AND (deleted = 0 OR ( deleted = 1 AND ( wpp.value >= 85000 AND wpp.deleteddate >= (DATE_SUB(CURDATE(), INTERVAL 6 MONTH)) ) ) ) ) AND (0 OR (wpp.srp = 1) ) AND ( wpp.isbudget IS NULL OR wpp.isbudget <> 1 ) AND ( wpp.deleted IS NULL OR wpp.deleted <> 1 ) WHERE wp_posts.post_type="used-product" AND wpp.value > 0 AND wp_posts.post_status="publish" GROUP BY r, minvalue, maxvalue

0
kero 1 month 2021-10-25T10:29:19-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse