Example #1
0
 /**
  * @param $characterName
  * @param $characterID
  * @param $characterOwnerHash
  *
  * @return int
  */
 public function createUserWithCrest($characterName, $characterID, $characterOwnerHash)
 {
     $id = $this->db->queryField("SELECT id FROM users WHERE characterName = :characterName", "id", array(":characterName" => $characterName));
     if (!$id) {
         return $this->db->execute("INSERT INTO users (characterName, characterID, characterOwnerHash) VALUE (:characterName, :characterID, :characterOwnerHash)", array(":characterName" => $characterName, ":characterID" => $characterID, ":characterOwnerHash" => $characterOwnerHash), true);
     }
     return $id;
 }
Example #2
0
 /**
  * @param string $key
  * @param null $default
  *
  * @return null|string
  */
 function get($key, $default = null)
 {
     $value = $this->db->queryField("SELECT value FROM storage WHERE `key` = :key", "value", array(":key" => $key), 0);
     if (!$value) {
         return $default;
     }
     return $value;
 }