• 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)
  • Thread Starter darvsorceix

    (@darvsorceix)

    I solved this problem by myself. Whenever i insert new record to database who had structure 1×04 , “x” was changed to “×” and this was made by errors in queries above.

Viewing 1 replies (of 1 total)
  • The topic ‘Problem with variable inside get_results’ is closed to new replies.