Created
July 20, 2010 14:19
-
-
Save gavinblair/483014 to your computer and use it in GitHub Desktop.
Drupal 6: Get node titles and menu titles from all nodes of a type.
Dude... don't be so lazy :P. Type out the whole name of the tables (especially when they are that short), using table aliases just adds to confusion in long queries.
It's a short query, kept short by aliases. A lazy programmer is a happy programmer. :P
Not so good for examples though, seeing as it scrolls to the right :P
Updated.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The interesting thing here is the LEFT JOIN.
m.link_path contains the node id, but it's always preceded by "node/". For example, the link_path of node 2 is "node/2". Using CONCAT we can take that into consideration.