open All Channels
seplocked EVE Technology Lab
blankseplocked whats up with this
 
This thread is older than 90 days and has been locked due to inactivity.


 
Author Topic

epsilonion
Posted - 2011.07.21 16:36:00 - [1]
 

I am about to cry.. :D I only learn by doing, and the lack of documentation for the yapeel or whatever its called... I have descided to learn to program myself..

I ot this far, Pulled api from eve, and put the data into mysql...

the only problem is that it only puts in 5 members worth of info then crashes out....

any help please...

ommited api key,username and userid.. :D


$url = "http://api.eve-online.com/corp/MemberTracking.xml.aspx?userID=".$userID."&apiKey=".$apiKey."&characterID=".$characterID;

// create curl resource
$ch = curl_init();
// set url
curl_setopt($ch, CURLOPT_URL, $url);
//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// $output contains the output string
$output = curl_exec($ch);
// close curl resource to free up system resources
curl_close($ch);

//Initializes the XML Parser
$xml = new SimpleXMLElement($output);

foreach ($xml->xpath('//row') as $row) {

$characterID = $row['characterID'];
$name = $row['name'];
$startDateTime = $row['startDateTime'];
$baseID = $row['baseID'];
$base = $row['base'];
$title = $row['title'];
$logonDateTime = $row['logonDateTime'];
$logoffDateTime = $row['logoffDateTime'];
$locationID = $row['locationID'];
$location = $row['location'];
$shipTypeID = $row['shipTypeID'];
$shipType = $row['shipType'];
$roles = $row['roles'];
$grantableRoles = $row['grantableRoles'];

$sql = mysql_query("INSERT INTO apimembers (charid, name, startdate, baseid, base, title, logondate, logoffdate, locationid, location, shiptypeid, shiptype, roles, grantableroles)

VALUES('$characterID','$name','$startDateTime','$baseID','$base','$title','$logonDateTime','$logoffDateTime','$locationID','$location','$shipTypeID','$shipType','$roles','$grantableRoles')")

or die (mysql_error());


Zeta Zhul
Caldari
Preemptive Paranoia
Posted - 2011.07.21 17:58:00 - [2]
 

Any of those character names have an apostrophe? -> '

epsilonion
Posted - 2011.07.21 18:01:00 - [3]
 

soo if i strip down the names to only include numbers and letters hmm interesting will try that now... :D

ty

epsilonion
Posted - 2011.07.21 18:09:00 - [4]
 


$name = preg_replace('#[^A-Za-z0-9]#i', '', $row['name']);

I changed the above and I get the message below:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'thal','2011-07-21 10:00:00','2011-07-21 11:00:00','30004944','L5D-ZL','2998','No' at line 2

epsilonion
Posted - 2011.07.21 19:08:00 - [5]
 

$name = preg_replace('/\W/', '', $row['name']);


the above works well and puts all members into the database...

ty for the suggestion


 

This thread is older than 90 days and has been locked due to inactivity.


 


The new forums are live

Please adjust your bookmarks to https://forums.eveonline.com

These forums are archived and read-only