Forum

How to make a request to the database PostgreSQL

edited October 21 in Developers

Hello,
I want to write to a custom table all user session from a method taoDelivery/DeliveryServer/runDeliveryExecution
How to write a request?
$dbquery = new common_persistence_sql_dbal_Driver();
$dbquery->query('custom_table', ['field','value']);
Something like this?

Comments

  • Hello,
    I wrote the code here, but for some reason it doesn’t work. Where is the mistake?

    $storageService = $this->getServiceManager()->get(StorageInterface::SERVICE_ID);
    $persistence = $storageService->getPersistence();
    $sql = "select * from statements where predicate = 'http://www.tao.lu/Ontologies/generis.rdf#login';";
    $r = $persistence->exec($sql);
    print_r($r);

  • use common_persistence_SqlPersistence;
    use oat\oatbox\service\ServiceManager;

Sign In or Register to comment.

We use cookies on our website to support technical features that enhance your user experience. Cookie Policy Privacy Policy

×