diff options
author | Urban Müller | 2020-02-10 12:42:11 +0100 |
---|---|---|
committer | Urban Müller | 2020-02-10 12:42:11 +0100 |
commit | 82f082743cd53398957310498596f37d8d5f5aac (patch) | |
tree | c575b896d0289a51c512bcab2287e0e531de0cd0 | |
parent | 54b91bbc8f3b16ed98fbb7be4d3e6a934cde34c2 (diff) | |
download | itools-82f082743cd53398957310498596f37d8d5f5aac.tar.gz itools-82f082743cd53398957310498596f37d8d5f5aac.tar.bz2 itools-82f082743cd53398957310498596f37d8d5f5aac.zip |
return 0 for no modified records if query was optimized away
-rw-r--r-- | it_dbi.class | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/it_dbi.class b/it_dbi.class index 45a321d..633974e 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -514,7 +514,7 @@ function clear($pp = true) /** * Semi-internal: send a raw SQL query and return mysql result value * @param $query complete SQL query string - * @return raw MySQL result. May die if query fails and safety is big enough + * @return MySQL result which is false for errors. May die on error if safety is big enough */ function query($query, $p = array()) { @@ -805,13 +805,13 @@ function store($tags = array()) * Update current record or a number of records given by where condition * @param $tags key => value pairs (these have priority over changes in member vars) * @param $where condition to select records to be modified (if not current record) - * @return number of updated records (or false on error). WARNING: read LIMIT docs before using it + * @return number of modified records (or false on error). WARNING: read LIMIT docs before using it * Does not destroy internal state of last select() call */ function update($tags = array(), $where = null) { $this->_connect(); - $result = true; + $result = 0; # in case we optimize away the query /* Pre-processing, $tags is passed by reference and may be modified here */ $this->_write_pre_process($tags, 'UPDATE'); |