Skip to content

Instantly share code, notes, and snippets.

@alexbowers-tecmark
Created March 20, 2015 13:32
Show Gist options
  • Save alexbowers-tecmark/e94a19868f9803dcb874 to your computer and use it in GitHub Desktop.
Save alexbowers-tecmark/e94a19868f9803dcb874 to your computer and use it in GitHub Desktop.
Example response
Array
(
[0] => Array
(
[distinct Attributes.id] => 1
[name] => Colour
)
[1] => Array
(
[distinct Attributes.id] => 3
[name] => Weight
)
[2] => Array
(
[distinct Attributes.id] => 4
[name] => Size
)
[3] => Array
(
[distinct Attributes.id] => 5
[name] => type
)
[4] => Array
(
[distinct Attributes.id] => 2
[name] => Simple Colour
)
[5] => Array
(
[distinct Attributes.id] => 1
[name] => Colour
)
[6] => Array
(
[distinct Attributes.id] => 3
[name] => Weight
)
[7] => Array
(
[distinct Attributes.id] => 4
[name] => Size
)
[8] => Array
(
[distinct Attributes.id] => 5
[name] => type
)
[9] => Array
(
[distinct Attributes.id] => 2
[name] => Simple Colour
)
)
@alexbowers-tecmark
Copy link
Author

Here is the generated SQL code:

SELECT distinct Attributes.id, `Attributes`.`name` FROM `attributes` AS `Attributes` WHERE `Attributes`.`deleted` = 0 ORDER BY `Attributes`.`order_num` ASC LIMIT 10;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment