diff options
author | Andrey Andreev <narf@devilix.net> | 2015-09-22 17:01:05 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2015-09-22 17:01:05 +0200 |
commit | d2985b9a63a9bcb016ff7f8ce7430ec08b468f6a (patch) | |
tree | bd963960c6384054dc7ba8444c7efc55f5ab8bb5 /user_guide_src | |
parent | 4fbf2d1a8e2b6d33e92f3f353b05388fd3229bd7 (diff) |
[ci skip] Remove an example from DB docs
Users shouldn't be encouraged to use num_rows() that way ...
We had already decided on this awhile ago, this example
just slipped through.
Diffstat (limited to 'user_guide_src')
-rw-r--r-- | user_guide_src/source/database/examples.rst | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/user_guide_src/source/database/examples.rst b/user_guide_src/source/database/examples.rst index 8b3cc4701..5fd7fccfa 100644 --- a/user_guide_src/source/database/examples.rst +++ b/user_guide_src/source/database/examples.rst @@ -55,23 +55,6 @@ Standard Query With Multiple Results (Array Version) The above result_array() function returns an array of standard array indexes. Example: $row['title'] -Testing for Results -=================== - -If you run queries that might **not** produce a result, you are -encouraged to test for a result first using the num_rows() function:: - - $query = $this->db->query("YOUR QUERY"); - if ($query->num_rows() > 0) - { - foreach ($query->result() as $row) - { - echo $row->title; - echo $row->name; - echo $row->body; - } - } - Standard Query With Single Result ================================= |