beroNet / Open-PBX

embedded PBX based on Asterisk, which runs on a beroNet Gateway
MIT License
5 stars 3 forks source link

Why is function name 'insert_' in database.php? #4

Closed sebastianertz closed 11 years ago

sebastianertz commented 11 years ago

https://github.com/crich/beroNet-Open-PBX/blob/master/template/www/includes/database.php

function insert_ ($sql) {

    if (!($ok = sqlite_query($this->db, $sql))) {
        $this->err = "insert() failed: " . sqlite_error_string(sqlite_last_error($this->db));
        return false;
    }

    return $ok;
};
crich commented 11 years ago

do you mean the inconsistency compared to update,delete, select?

I guess it's maybe just a typo and has been used as is. We can change it back to insert, if it doesn't conflict with PHP keywords.

ghost commented 11 years ago

Well, it doesn't make sense to have functions like update, delete, select and insert, if they all do the same (and they do actually).

One single query-function should be sufficient.

ghost commented 11 years ago

I've unified most (hopefully all) database-queries from 'select', 'delete', 'update' and 'insert_' to 'query' in commit d14db754d4666f0501c3e309f0537bd4a0280e36 of the development-branch. The old methods are still available but will be removed in the future.