I’ve been at this for while, but can’t figure out why the below isn’t working. I have my date saved as a ‘MM/DD/YYYY’ string.
global $wpdb;
$new_day = $day->format("m/d/Y");
$qty = $wpdb->get_var( $wpdb->prepare(
"
SELECT qty
FROM $wpdb->specials
WHERE date = %s
",
$new_day
));
I’ll guess that
$wpdb->specials
isn’t giving you what you expect. custom tables have to referenced like$wpdb->prefix . 'specials'