public function fetch_assoc_list($sql, $assign_by = null)
    {

        if (empty($sql)) return false;

        $result = array();

        // send the query
        $res = $this->query($sql);

        if (empty($res)) return false;

        while (($row = @mysql_fetch_assoc($res)) !== false) {
            if (!empty($assign_by)) {
                $result[$row[$assign_by]] = $row;
            } elseif (!empty($assign_by) && is_array($assign_by)) {
                $key = '';
                // for more complex keys
                foreach ($assign_by as $key_w) {
                    $key = "- $row[$key_w]";
                }
                // removes the first '- '
                $key          = substr($key, 2);
                $result[$key] = $row;
            } else {
                $result[] = $row;
            }
        }

        // free the ressource afterwards
        $this->free($res);

        return $result;
    }