Solution, i call in a line other thing i do for creating a cache.
function PilotfromInternet($pilot_number){
if ($pilot_number==’’) $pilot_number=valpilot(“CHECK”);
list($cache)=avalues319(“select ESI_NAME from ESI_CACHE where ESI_TYPE=‘PILOT’ and ESI_ID=’$pilot_number’”);
if ($cache<>’’) return trim($cache);
$useragent=“your agent”;
$ch = curl_init();
$lookup_url=“https://esi.evetech.net/latest/characters/$pilot_number/”;
curl_setopt($ch, CURLOPT_URL, $lookup_url);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
$result = curl_exec($ch);
curl_close($ch);
if ($result===false) {
//auth_error(‘No such character on the API’);
}
$chardetails=json_decode($result);
/*$corporationID=$chardetails->corporation_id;
$allianceID=$chardetails->alliance_id;
*/
$name=($chardetails->name);
if ($name<>’’){
$name=addslashes($name);
$sql=“insert into ESI_CACHE (ESI_ID,ESI_TYPE,ESI_NAME,ESI_WHEN) values (’$pilot_number’,‘PILOT’,’$name’,now())”;
mysql_query($sql) or die(“error in esi cache pilot register”.mysql_error());
}