Example #1
0
 public static function GetByName($name)
 {
     if ($name == null) {
         return null;
     }
     global $MySQL;
     $query = "SELECT * FROM " . System::$Configuration["Database.TablePrefix"] . "Places WHERE place_Name = '" . $MySQL->real_escape_string($name) . "'";
     $result = $MySQL->query($query);
     if ($result->num_rows > 0) {
         $values = $result->fetch_assoc();
         return Place::GetByAssoc($values);
     }
     return null;
 }
Example #2
0
            $item = Group::GetByAssoc($values);
            echo "{ \"Category\": \"Groups\", \"Item\": ";
            echo $item->ToJSON();
            echo " }";
            if ($i + $previousCount < $totalCount - 1) {
                echo ", ";
            }
        }
    });
}
if ($availableTables["Places"]) {
    $lookupTables[] = new LookupTable("Places", "place_Name", function ($table, $totalCount, $previousCount) {
        $result = $table->Result;
        for ($i = 0; $i < $result->num_rows; $i++) {
            $values = $result->fetch_assoc();
            $item = Place::GetByAssoc($values);
            echo "{ \"Category\": \"Places\", \"Item\": ";
            echo $item->ToJSON();
            echo " }";
            if ($i + $previousCount < $totalCount - 1) {
                echo ", ";
            }
        }
    });
}
if ($availableTables["Pages"]) {
    $lookupTables[] = new LookupTable("Pages", "page_Title", function ($table, $totalCount, $previousCount) {
        $result = $table->Result;
        for ($i = 0; $i < $result->num_rows; $i++) {
            $values = $result->fetch_assoc();
            $item = Page::GetByAssoc($values);