|
|
@@ -2,14 +2,14 @@
|
|
|
require_once __DIR__."/../config.php";
|
|
|
require_once __DIR__."/../redis/function.php";
|
|
|
|
|
|
-if (PHP_SAPI == "cli" || isset($_COOKIE["userid"]))
|
|
|
+if (PHP_SAPI == "cli" || isset($_COOKIE["userid"]))
|
|
|
{
|
|
|
$redis = redis_connect();
|
|
|
if ($redis != false) {
|
|
|
$dbh = new PDO(_DICT_DB_REGULAR_, Database["user"], Database["password"], array(PDO::ATTR_PERSISTENT => true));
|
|
|
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
|
|
|
-
|
|
|
- $query = "select * from (SELECT pali,parts from "._TABLE_DICT_REGULAR_." where 1 order by confidence DESC ) where 1 group by pali";
|
|
|
+
|
|
|
+ $query = "SELECT * from (SELECT pali,parts from "._TABLE_DICT_REGULAR_." order by confidence DESC ) group by pali";
|
|
|
$stmt = $dbh->query($query);
|
|
|
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
|
|
# code...
|
|
|
@@ -21,4 +21,4 @@ if (PHP_SAPI == "cli" || isset($_COOKIE["userid"]))
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-?>
|
|
|
+?>
|