function getProductById($id) { $db = new connect(); $select = "select * from products where ProductID={$id}"; $result = $db->getInstance($select); return $result; }
private function setConexion() { $conf = connect::getInstance(); $this->servidor = $conf->getHostDB(); $this->base_datos = $conf->getDB(); $this->usuario = $conf->getUserDB(); $this->password = $conf->getPassDB(); }
$transport = new HttpServer('application/json'); if ($logger) { $transport->setLogger($logger); } $encoder = new JsonRpc20Encoder(); if ($logger) { $encoder->setLogger($logger); } if ($settings->isEncryptionEnabled()) { $encoder = new RsaEncoder($encoder, $settings->getRsaRemotePublicKey(), $settings->getRsaLocalPrivateKey()); } $server = new Server($transport, $encoder, $endpoint); try { $server->handle(); } catch (Exception $e) { if ($logger && $logger->isHandling(Logger::ERROR)) { $logger->addError($e->getMessage()); } ob_start(); while (ob_end_clean()) { } header('HTTP/1.0 500 Internal Server Error'); header("Status: 500 Internal Server Error"); header('Content-Type: text/plain; charset=utf-8'); echo '500 Internal Server Error'; } exit; } } connect::getInstance()->run();