diff --git a/api.php b/api.php index 555b96fd..c5e7fe22 100644 --- a/api.php +++ b/api.php @@ -731,7 +731,7 @@ protected function deleteObject($key,$tables,$db) { protected function findRelations($tables,$database,$db) { $collect = array(); $select = array(); - if (count($tables)>1) { + while (count($tables)>1) { $table0 = array_shift($tables); $result = $this->query($db,$this->queries['reflect_belongs_to'],array($table0,$tables,$database,$database));