From 403beee03f2e9c11f144bfe872d6787f6770d037 Mon Sep 17 00:00:00 2001 From: Smoking Date: Tue, 22 Jun 2021 11:00:13 +0300 Subject: [PATCH] fix notice --- ActiveRecord.php | 4 ++-- lib/Connection.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ActiveRecord.php b/ActiveRecord.php index 084587547..14b244154 100644 --- a/ActiveRecord.php +++ b/ActiveRecord.php @@ -40,11 +40,11 @@ function activerecord_autoload($class_name) foreach ($namespaces as $directory) $directories[] = $directory; - $root .= DIRECTORY_SEPARATOR . implode($directories, DIRECTORY_SEPARATOR); + $root .= DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $directories); } $file = "$root/$class_name.php"; if (file_exists($file)) require_once $file; -} \ No newline at end of file +} diff --git a/lib/Connection.php b/lib/Connection.php index 69e8a1b20..31870f80c 100644 --- a/lib/Connection.php +++ b/lib/Connection.php @@ -349,7 +349,7 @@ public function query_and_fetch_one($sql, &$values=array()) { $sth = $this->query($sql, $values); $row = $sth->fetch(PDO::FETCH_NUM); - return $row[0]; + return $row ? $row[0] : false; } /**