Browse Source

Fixed bug with error 'invalid arguments passed to implode()'

spficklin 12 years ago
parent
commit
6c1b95e7df
1 changed files with 6 additions and 1 deletions
  1. 6 1
      tripal_core/api/tripal_core.api.inc

+ 6 - 1
tripal_core/api/tripal_core.api.inc

@@ -1402,7 +1402,12 @@ function tripal_core_chado_select($table, $columns, $values, $options = NULL) {
       $psql = drupal_substr($psql, 0, -2);  // get rid of the trailing ', '
     }
     // finish constructing the prepared SQL statement
-    $psql =  "PREPARE " . $options['statement_name'] . " (" . implode(', ', $idatatypes) . ") AS " . $psql;
+    if (count($idatatypes) > 0) {
+      $psql =  "PREPARE " . $options['statement_name'] . " (" . implode(', ', $idatatypes) . ") AS " . $psql;
+    } 
+    else {
+      $psql =  "PREPARE " . $options['statement_name'] . " () AS " . $psql;
+    }
 
   } // end if(empty($where)){ } else {