Stored Procedures with Parameters
Closed this issue · 3 comments
MrPresidentWhite commented
Hi,
I have a stored Procedure with parameters. Can you give me a hint, how the url or my php code have to look? My current code looks like shown in the screenshot down below.
function getModell($herstellerID) {
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://aw96.de/api.php/getModell",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache"
),
));
return $response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
}
mevdschee commented
Like this:
<?php
function getModell(/*$herstellerID*/) {
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://aw96.de/api.php/getModell",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
return json_decode($response);
}
var_dump(getModell());
MrPresidentWhite commented
MrPresidentWhite commented
I found another solution