Index: phplistbackend/phplistbackend.module
===================================================================
--- phplistbackend/phplistbackend.module	(revision 18)
+++ phplistbackend/phplistbackend.module	(working copy)
@@ -427,20 +427,16 @@ function phplistbackend_get_lists($activ
   }
   // Switch DB
   db_set_active('phplist');
-  // Build query
-  $query = "SELECT id, name FROM {%s}";
-  // Set placeholder
-  $placeholder = array();
-  $placeholder[] = $prefix['prefix'] . 'list';
+  // Set table name
+  $tbl = $prefix['prefix'] . 'list';
+  
+  $select = db_select($tbl,'p')->fields('p',array('id','name'));
   // If no arg was passed or arg was TRUE, only get active ones
-  if ($active) {
-    $query .= " WHERE active = 1";
-  }
-  $results = db_query($query, $placeholder);
-  while ($result = db_fetch_array($results)) {
-    // Populate array
-    $lists[$result['id']] = $result['name'];
+  if($active) {
+    $select->condition('active',1);
   }
+  $lists = $select->execute()->fetchAllKeyed();
+
   // Switch DB back
   db_set_active('default');
   // Spit out array
