Skip to content

Instantly share code, notes, and snippets.

@bobmagicii
Last active December 17, 2015 09:29
Show Gist options
  • Save bobmagicii/5587790 to your computer and use it in GitHub Desktop.
Save bobmagicii/5587790 to your computer and use it in GitHub Desktop.
<?php
$sql = new m\Database\Query;
$sql->Select('*')
->From('dma_objects')
->NaturalJoin('dma_objects_vehicles')
->Where('obj_type="vehicle"')->AndWhere('u_id=:OwnerID')
->OrderBy('obj_time_created ASC');
echo $sql;
// SELECT *
// FROM dma_objects
// NATURAL JOIN dma_objects_vehicles
// WHERE obj_type="vehicle" AND u_id=:OwnerID
// ORDER BY obj_time_created ASC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment