不过,您的代码看起来不错。但请尝试以下方法-
$current_date = $_POST[\'current_date\'];
$current_date = date( \'Y-m-d\', strtotime($current_date) );
$post_id = (int) $_POST[\'post_id\'];
$query = $wpdb->prepare( "SELECT start_date FROM {$wpdb->prefix}booking_history WHERE start_date=%s AND post_id=%d", $current_date, $post_id );
/* get_col used to retrieve column records */
$results = $wpdb->get_col( $query );
echo \'<pre>\'; print_r( $results ); echo \'</pre>\';