Skip to content

Instantly share code, notes, and snippets.

@Tocacar
Created April 20, 2012 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tocacar/2428131 to your computer and use it in GitHub Desktop.
Save Tocacar/2428131 to your computer and use it in GitHub Desktop.
Another query
//this is giving me an array of project_licence id numbers
public function getAssignedProjectLicenceIds() {
$user_id = $this->getId();
$connection = Doctrine_Manager::connection();
$query = 'SELECT
p.id as ids
FROM
project_licence p
INNER JOIN
lab l
ON
p.lab_id = l.id
RIGHT OUTER JOIN
lab_user lu
ON
lu.lab_id = l.id
WHERE
lu.user_id = ' . $user_id;
$statement = $connection->execute($query);
$statement->execute();
$resultset = $statement->fetchAll(PDO::FETCH_COLUMN, 0);
return $resultset;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment