Problem with variable inside get_results
-
Hello , i have problem with variables:
$episode = $_POST['episode']; $is_in_database = $wpdb->get_results( $wpdb->prepare("SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id = %d AND object_id IN (SELECT ID FROM wp_posts WHERE post_title = '1x04')", $get_term_taxonomy_id, $episode)) or die('Error');
Is working fine but whenever i am trying to use variable $episode it does not.
$episode = $_POST['episode']; $is_in_database = $wpdb->get_results( $wpdb->prepare("SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id = %d AND object_id IN (SELECT ID FROM wp_posts WHERE post_title = %s)", $get_term_taxonomy_id, $episode)) or die('Error');
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Problem with variable inside get_results’ is closed to new replies.