summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/database
diff options
context:
space:
mode:
authorLonnie Ezell <lonnieje@gmail.com>2015-07-23 04:48:02 +0200
committerLonnie Ezell <lonnieje@gmail.com>2015-07-23 04:48:02 +0200
commitc87a66b4023396900aa349a42f4a93bc9f6e8fa9 (patch)
treef2ffa04ea3798a5cd661fb1f6c8239b5c5fdcc08 /user_guide_src/source/database
parentabf089a6c8f50c86601548abf7e827f4d067a348 (diff)
Tabs vs Spaces and the forgotten rewrite.
Diffstat (limited to 'user_guide_src/source/database')
-rw-r--r--user_guide_src/source/database/results.rst12
1 files changed, 6 insertions, 6 deletions
diff --git a/user_guide_src/source/database/results.rst b/user_guide_src/source/database/results.rst
index 3837a7736..071d9718e 100644
--- a/user_guide_src/source/database/results.rst
+++ b/user_guide_src/source/database/results.rst
@@ -199,9 +199,9 @@ Example::
public function __set($name, $value)
{
if ($name === 'last_login')
- {
- $this->last_login = DateTime::createFromFormat('U', $value);
- }
+ {
+ $this->last_login = DateTime::createFromFormat('U', $value);
+ }
}
public function __get($name)
@@ -243,10 +243,10 @@ Example::
$query = $this->db->query("YOUR QUERY");
- if ($query->num_rows() > 0)
- {
- $row = $query->custom_row_object(0, 'User');
+ $row = $query->custom_row_object(0, 'User');
+ if (is_object($row))
+ {
echo $row->email; // access attributes
echo $row->last_login('Y-m-d'); // access class methods
}