Netzflut

Webdesign, Webentwicklung, Drupal & Zeuchs

MYSQL Querys Beispiele (Drupal)

Inhaltsverzeichniss

    Selects a Term that has no Parents/is a root term

    SELECT term_data.name, term_data.tid FROM term_data LEFT JOIN term_hierarchy ON
    term_data.tid = term_hierarchy.tid WHERE term_data.vid = 33 AND term_hierarchy.parent = 0 AND term_data.name = 'Beton'

    Userpoints reset for cron

    UPDATE TABLE userpoints SET points = 15000 WHERE uid > 1
    SELECT userpoints.points FROM userpoints, users_roles WHERE userpoints.uid = users_roles.uid AND users_roles.rid = 4
    UPDATE userpoints, users_roles SET userpoints.points = 15000 WHERE userpoints.uid = users_roles.uid AND users_roles.rid = 4

    Cron syntax

    mysql --user=root --password=PASSWORD -D TEMP < /home/www-data/free_reset.sql

    i18n - set source nodes tnid

    Ich hatte Probleme, weil momentan 01.06.2012 Probleme mit entitycache vorliegen. Wenn es mit i18nn_sync an ist sind alle tnids des source nodes nicht gesetzt.
    UPDATE node SET node.tnid = node.nid WHERE node.type = "content-type-name" AND node.language = "en"

    Design&Code: