Skip to content

Instantly share code, notes, and snippets.

@AstDerek
Created February 17, 2013 04:56
Show Gist options
  • Save AstDerek/4970243 to your computer and use it in GitHub Desktop.
Save AstDerek/4970243 to your computer and use it in GitHub Desktop.
<?php
// Query with no Active Record
$query = "SELECT questions.* FROM assessments LEFT JOIN questions ON assessments.id=questions.assessment_id WHERE assessments.id=4";
// Query with ORM (Idiorm)
ORM::for_table('assessments')
->select('questions.*')
->join('questions',array('assessments.id','=','questions.assessment_id'))
->where('assessments.id',4)
->find_many();
// Query with Active Record (Paris)
Model::factory('Assessment')->has_many('Question');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment