Skip to main content

Home/ Drupal for Developers/ Group items tagged sql

Rss Feed Group items tagged

Hendy Irawan

Eclipse SQL Explorer - 0 views

  •  
    "Eclipse SQL Explorer is a thin SQL client that allows you to query and browse any JDBC compliant database. It supports plugins with specialized functionality for individual databases (Oracle, DB2 and MySQL) and can be extended to include specialized support for other databases. The project started as a fork from the original JFaceDb project which has gone commercial and uses some of the core libraries of SQuirreL SQL. The application is available as a standalone client or as a plugin for Eclipse 3.2."
Daniel Gregoire

Programmatically Create, Insert, and Update CCK Nodes | doug | CivicActions - 2 views

  • Always use content_database_info to get the database info. For example:   $field1 = content_database_info(content_fields('yourfield1', 'yourtable'));  $table1 = $field1['table'];  $column1 = $field1['columns']['value']['column'];  $field2 = content_database_info(content_fields('yourfield2', 'yourtable'));  $table2 = $field2['table'];  $column2 = $field2['columns']['value']['column'];  if ($table1 == $table2) {    $sql = "SELECT n.*, t1.$column1, t1.$column2 FROM {node} n ";    $sql .= " INNER JOIN {$table1} t1 ON t1.nid = n.nid AND t1.vid = n.vid";  }  else {    $sql = "SELECT n.*, t1.$column1, t2.$column2 FROM {node} n ";    $sql .= " INNER JOIN {$table1} t1 ON t1.nid = n.nid AND t1.vid = n.vid";    $sql .= " INNER JOIN {$table2} t2 ON t2.nid = n.nid AND t2.vid = n.vid";  }  $sql .= " WHERE n.nid = %d";
  •  
    Important point: Using special functions to let CCK get the proper name of the field (allowing users to make CCK changes in the UI and let your code continue to work).
1 - 3 of 3
Showing 20 items per page