From 56f6c96f082768140f014f15332599db76e034b1 Mon Sep 17 00:00:00 2001 From: Jason Skomorowski Date: Thu, 10 Feb 2011 19:46:25 +0100 Subject: [PATCH] Better database handling. --- mkdru.module | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mkdru.module b/mkdru.module index 0c9e36b..6fb792a 100644 --- a/mkdru.module +++ b/mkdru.module @@ -193,9 +193,7 @@ function mkdru_validate($node) { * Implementation of hook_insert(). */ function mkdru_insert($node) { - db_query("INSERT INTO {mkdru} (nid, vid, pz2_path, use_sessions, source_max, author_max, subject_max, sp_user, sp_pass) ". - "VALUES (%d, %d, '%s', %d, %d, %d, %d, '%s', '%s')", - $node->nid, $node->vid, $node->pz2_path, $node->use_sessions, $node->source_max, $node->author_max, $node->subject_max, $node->sp_user, $node->sp_pass); + drupal_write_record('mkdru', $node); } /** @@ -207,7 +205,7 @@ function mkdru_update($node) { mkdru_insert($node); } else { - db_query("UPDATE {mkdru} SET pz2_path = '%s', use_sessions = %d, source_max = %d, author_max = %d, subject_max = %d, sp_user = '%s', sp_pass = '%s' WHERE vid = %d", $node->pz2_path, $node->use_sessions, $node->source_max, $node->author_max, $node->subject_max, $node->sp_user, $node->sp_pass, $node->vid); + drupal_write_record('mkdru', $node, 'vid'); } } -- 1.7.10.4