I am using the function views_get_view and it's working fine if am using this once in a function. But when I am calling this function multiple times with different arguments in the same function the result is going to lose. In that case, the result always be same as coming with first-time arguments. Following are my code.
$viewname = "profile_match_with_job";
$display_id = "block_3";
$view = views_get_view($viewname);
$view->set_display($display_id);
$view->set_arguments(array(138,70)); // views Contextual filter parameters
$view->pre_execute();
$view->execute();
$myresult = $view->result;
// here $myresult array showing the correct result
But I am calling the same thing with dfferent argument then the result is not corrct like this
$viewname = "profile_match_with_job";
$display_id = "block_3";
$view = views_get_view($viewname);
$view->set_display($display_id);
$view->set_arguments(array(138,80)); // views Contextual filter parameters
$view->pre_execute();
$view->execute();
$myresult = $view->result;
// here $myresult array showing the same result but in that case I have chnaged the param values from 138,70 to 138,80