|
|
|
@ -16,7 +16,7 @@ class MySQL {
@@ -16,7 +16,7 @@ class MySQL {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getNamespaceName($namehash) { |
|
|
|
|
public function getNamespaceValueByNS($ns) { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
|
@ -33,7 +33,7 @@ class MySQL {
@@ -33,7 +33,7 @@ class MySQL {
|
|
|
|
|
|
|
|
|
|
LIMIT 1'); |
|
|
|
|
|
|
|
|
|
$query->execute([$namehash]); |
|
|
|
|
$query->execute([$ns]); |
|
|
|
|
|
|
|
|
|
return $query->rowCount() ? $query->fetch()['value'] : []; |
|
|
|
|
|
|
|
|
@ -44,6 +44,28 @@ class MySQL {
@@ -44,6 +44,28 @@ class MySQL {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getNamespaceHashByTX($txid) { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
$query = $this->_db->prepare('SELECT `namespace`.`hash` |
|
|
|
|
|
|
|
|
|
FROM `namespace` |
|
|
|
|
JOIN `data` ON (`data`.`nameSpaceId` = `namespace`.`nameSpaceId`) |
|
|
|
|
|
|
|
|
|
WHERE `data`.`txid` = ?'); |
|
|
|
|
|
|
|
|
|
$query->execute([$txid]); |
|
|
|
|
|
|
|
|
|
return $query->rowCount() ? $query->fetch()['hash'] : []; |
|
|
|
|
|
|
|
|
|
} catch(PDOException $e) { |
|
|
|
|
|
|
|
|
|
trigger_error($e->getMessage()); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getData($namehash = false, $txid = false, $search = false, $start = 0, $limit = 10) { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|