From d2985b9a63a9bcb016ff7f8ce7430ec08b468f6a Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 22 Sep 2015 18:01:05 +0300 Subject: [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. --- user_guide_src/source/database/examples.rst | 17 ----------------- 1 file changed, 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 ================================= -- cgit v1.2.3-24-g4f1b