caterpillar/api/data/utils/fill_database.php

21 lines
485 B
PHP

<?php
/**
* Fill API backend SQL database with data from government open data.
*/
// CIS_bdpm.txt
// This database holds the list of medicines with status, holder, name, etc.
$URL = "http://localhost/";
function post($url, $data) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
return $response;
}