Skip to content

Instantly share code, notes, and snippets.

@gavinblair
Created July 20, 2010 14:19
Show Gist options
  • Save gavinblair/483014 to your computer and use it in GitHub Desktop.
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.
SELECT node.title, node.nid, menu_links.link_title FROM node
LEFT JOIN menu_links ON (link_path = CONCAT('node/', node.nid))
WHERE node.type = 'page'
@gavinblair
Copy link
Author

It's a short query, kept short by aliases. A lazy programmer is a happy programmer. :P

@SeanJA
Copy link

SeanJA commented Jul 21, 2010

Not so good for examples though, seeing as it scrolls to the right :P

@gavinblair
Copy link
Author

Updated.

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