Browse Source

表名使用配置文件变量

visuddhinanda 4 years ago
parent
commit
8892c0253f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/db/pali_text.php

+ 2 - 2
app/db/pali_text.php

@@ -66,7 +66,7 @@ class PaliText extends Table
 				}
 			}
 			$title="";
-			$query = "select * from pali_text where book = ? and paragraph = ?";
+			$query = "SELECT * from "._TABLE_PALI_TEXT_." where book = ? and paragraph = ?";
 			$stmt = $this->dbh->prepare($query);
 			$stmt->execute(array($book,$para));
 			$result = $stmt->fetch(PDO::FETCH_ASSOC);
@@ -75,7 +75,7 @@ class PaliText extends Table
 					$title= $result["toc"];
 				}
 				else{
-					$query = "select * from pali_text where book = ? and paragraph = ?";
+					$query = "SELECT * from "._TABLE_PALI_TEXT_." where book = ? and paragraph = ?";
 					$stmt = $this->dbh->prepare($query);
 					$stmt->execute(array($book,$result["parent"]));
 					$result = $stmt->fetch(PDO::FETCH_ASSOC);