Get node details from Drupal
Currently I'm trying to migrate my blog from drupal to something must lighter, migrating data is indeed the first step!
A simple SQL statement was very useful to get the node details, which will be very useful in making a custom made CMS.
This is very tiny entry in my blog to remind me that the migration is still pending!
THE SQL CODE TO GET DRUPAL NODE DETAILS :
"SELECT node.nid as id,
node.status as status,
revision.title as title,
revision.body as body
FROM node_revisions as revision
JOIN node as node
ON node.nid = revision.nid
WHERE node.status = 1
ORDER BY node.nid
DESC ";
The above got simple does the below :
Gets the id and status from node table.
Gets Title and body from revisions table.
For all linked node and revisions which is published (i.e status = 1 and ids are same).
Orders them by node id from the latest to oldest entries.
Hope this helps the one who is pawing at some raw Drupal data!
Recent blog posts
- watir-webdriver web inspector
- gem list to gemfile
- Packing ruby2.0 on debian.
- Made it into The Guinness Book!
- to_h in ruby 2.0
- Filter elements by pattern jQuery.
- Better HTML password fields for mobile ?
- Grayscale image when user offline
- nth-child CSS pseudo-class Christmas colors
- EventEmitter in nodejs