Welcome Guest, Not a member yet? Register   Sign In
passing variable in model
#1

PHP Code:
function get_articles() {
    $articles $this->db->query("SELECT * FROM tbl_articles WHERE status = '1' AND lang = '$this->locale' ORDER BY id DESC");    foreach($articles->getResult('array') as $a) {
      $articleId $a['id']; // I would like pass this variable to get_ip function
    }
    return $articles;
  }  

function get_ip() {
    $test $this->db->query("SELECT * FROM tbl_images_preview WHERE article_id = ".$articleId."");
    return $test;
  

I have this snippet in my model. How can I pass the variable $articleId to get_ip function?

Thanks. Smile
Reply


Messages In This Thread
passing variable in model - by eleumas - 02-25-2021, 02:54 AM
RE: passing variable in model - by Chroma - 02-25-2021, 08:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB