Skip to content

Instantly share code, notes, and snippets.

@rdobrynin
Created February 18, 2015 09:28
Show Gist options
  • Save rdobrynin/9e5543c3e742d3db7717 to your computer and use it in GitHub Desktop.
Save rdobrynin/9e5543c3e742d3db7717 to your computer and use it in GitHub Desktop.

Revisions

  1. rdobrynin created this gist Feb 18, 2015.
    22 changes: 22 additions & 0 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    <?
    public function getProjectUsers($pid) {
    $data = array();
    $query = $this->db->select('*')
    ->from('projects')
    ->join('users', 'projects.uid = users.id')
    ->where('projects.assign', 0)
    ->where('projects.pid', $pid)
    ->get();
    if ($query->num_rows() > 0)
    {
    foreach ($query->result() as $row) {
    $data[] = $row;
    }
    }
    else {
    $data = false;
    }

    $query->free_result();
    return $data;
    }