Skip to content

Instantly share code, notes, and snippets.

@ziyahan
Last active August 29, 2015 14:12
Show Gist options
  • Save ziyahan/c91c66cccc640dc89484 to your computer and use it in GitHub Desktop.
Save ziyahan/c91c66cccc640dc89484 to your computer and use it in GitHub Desktop.
Sql Query Builder Class for PHP
$this->sqlquerybuilder->select(array(
"project.id",
"company.explanation AS companyName",
"project.projectCode",
"project.projectName"
))
->from("c_project project")
->join("left", "p_company company", array("company.id=cariNo"))
->join("left", "p_projectStatus projectStatus", array("projectStatus.id=project.projectStatus"))
->join("left", "c_users technicPersonal", array("project.projectTechnicAuthorized=technicPersonal.usrId"))
->join("left", "c_users salesPersonal", array("project.projectSaleAuthorized=salesPersonal.usrId"))
->join("left", "p_projectTechnicStatus projectTechnicStatus", array("projectTechnicStatus.id=project.projectTechnicalStatus"));
->where(array(
array("column"=>"deleted","operator"=>"=","value"=>0),
array("column"=>"createUserId","operator"=>"=","value"=>1),
array("column"=>"projectEndDate","operator"=>"<=","value"=>"2014-12-31"),
))
->build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment