0){ $i = mysql_fetch_object($result); $result2 = mysql_query("SELECT * FROM wp_posts WHERE ID='".$i->wp_post_id."'", $DB); $rows2 = mysql_num_rows($result2); //print_r($i); if($rows2>0){ $post = mysql_fetch_object($result2); //print_r($post); //return; Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: " . 'http://www.emanuellevy.com/' . $i->article_type .'/'. $post->post_name ); }else{ echo "nah"; } // }else{ echo 'none'; }