| Pages: [1] :: one page |
| Author |
Thread Statistics | Show CCP posts - 0 post(s) |

Atomic Hedgehog
Starcade Group Elemental Tide
0
|
Posted - 2013.08.16 11:02:00 -
[1] - Quote
Ok I have been searching all over for any way that works..and i think im close but im now stuck..so sending out a plea to all the api code gurus that have figured this out already.
How did you get your walletjournal.xml to work, and how did u successfully upload it into a mysql database?
this is the script i've been testing wtih and I've got the database connection stuff working, but im unable to properly parse the xml and insert it into the database, im getting errors about the foreach statement not giving proper arguments..any and all help greatly appreacited thank you.
--- removed the php starting tag, forum dosnt like it
error_reporting(E_ALL);
include "connection.php"; // this works perfectly, no problems connecting to mysql, or the db
$keyID = "something" ; $vcode= "something"; $characterID= "something";
$url = "https://api.eveonline.com/char/WalletJournal.xml.aspx?keyID=$keyid&Vcode=$vcode&characterID=$chracterID";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE): curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE):
$data = curl_exec($ch);
curl_close($ch);
$doc = new SimpleXmlElement($data, LIBXML_NODATA);
foreach ( $doc -> result -> rowset -> row as $row ) { $datee = $row ['date']'; $refID = $row ['refid']' $refTypeID = $row ['refTypeID']; $ownerName1 = mysql_real_escape_string($row['ownerName1']); $ownerID1 = $row['ownerID1']; $ownerName2 = mysql_real_escape_string($row['ownerName2']); $ownerID2 = $row['ownerID2']; $argName1 = $row['argName1']; $argID1 = $row['argID1']; $amount = $row['amount']; $balance = $row['balance']; $reason = $row['reason'];
$time = strtotime('- 30 minute',$datee); echo $time; /if the date is within the last 30 minutes if($datee >= $time) { if($ownerName1 != '$exclude_char') { $precheck = mysql_query("SELECT refID FROM walletJournal WHERE date = '$datee', AND amount = '$amount'"); $precheck2 = mysql_num_rows($precheck);
if($precheck2['refID'] < 1) { mysql_query("INSERT INTO walletJournal (date, refID, refTypeID, ownerName1, ownerID1, ownerName2, ownerID2, argName1, argID1, amount, balance, reason) VALUES ('$datee', '$refID', '$refTypeID', '$ownerName1', '$ownerID1', '$ownerName2', '$ownerID2', '$argName1', '$argID1', '$amount', '$balance', '$reason')")or die(mysql_error()); } } }
}
--- removed php ending tag, forum dosnt like it
|

Louis Vitton
3-Strikes Nulli Secunda
40
|
Posted - 2013.08.16 11:21:00 -
[2] - Quote
have you looked at yapeal? http://wiki.eve-id.net/Yapeal
or alternatively phealING http://github.com/3rdpartyeve/phealng/
Yapeal will load the data into a database for you and does the leg work of ensuring cache timer is not breached. Its as simple as your sql querys to pull the data out. |

Steve Ronuken
Fuzzwork Enterprises Vote Steve Ronuken for CSM
1807
|
Posted - 2013.08.16 11:47:00 -
[3] - Quote
Louis is entirely right. Use one of the frameworks to do the heavy lifting for you. Makes life a lot easier.
Aside from that:
Look into using PDO. Or little Bobby Tables might come along and drop your database.
Did you mean NODATA, or NOCDATA
If you're ever wondering about the data you're getting back, var_dump() is your friend. Steve Ronuken for CSM 9!-á I'm starting early :) Handy tools and an SDE conversion Twitter: @fuzzysteve on Twitter |

Innominate
GoonWaffe Goonswarm Federation
247
|
Posted - 2013.08.16 12:00:00 -
[4] - Quote
Please please please please please do not use mysql_* functions, they are old, and unsafe and your code is highly exploitable.
Please look into PDO and prepared statements.
http://us2.php.net/manual/en/pdo.prepared-statements.php |

Atomic Hedgehog
Starcade Group Elemental Tide
0
|
Posted - 2013.08.16 20:08:00 -
[5] - Quote
I looked into several different frameworks but couldnt get any of them to work, either they are no longer supported, or they required extra stuff my hosting provider dosnt allow for.
So I'll have to continue working with what I have.
anyone else actually have a walletjournel working without using one of the frameworks ???
yes I realize some of the calls in the code are outdated and insecure now, but that isn't a concern for what this application is designed for, I just simply want to get something working for testing purposes. |

ItsmeHcK1
Kicked. Shadow Cartel
80
|
Posted - 2013.08.16 22:23:00 -
[6] - Quote
Well, for one you misspelled the variable name...
Atomic Hedgehog wrote:$keyID = "something" ; $vcode= "something"; $characterID= "something";
$url = "https://api.eveonline.com/char/WalletJournal.xml.aspx?keyID=$keyid&Vcode=$vcode&characterID=$chracterID"; Also, the actual error might be helpful.
|

Ydnari
Estrale Frontiers Project Wildfire
222
|
Posted - 2013.08.16 22:39:00 -
[7] - Quote
Quote: $characterID= "something";
$url = "https://api.eveonline.com/char/WalletJournal.xml.aspx?keyID=$keyid&Vcode=$vcode&characterID=$chracterID";
Turn your error level reporting up further, you've misspelled the variable.
Then delete this code and use PhealNG. -- |

Atomic Hedgehog
Starcade Group Elemental Tide
0
|
Posted - 2013.08.17 02:13:00 -
[8] - Quote
Ydnari wrote:Quote: $characterID= "something";
$url = "https://api.eveonline.com/char/WalletJournal.xml.aspx?keyID=$keyid&Vcode=$vcode&characterID=$chracterID";
Turn your error level reporting up further, you've misspelled the variable. Then delete this code and use PhealNG.
thank you but i do not wish to use additional libraries....i am working on just some simple code to fetch the api, parse it and upload into the mysql database, it shouldnt need to be dependent on all these other libraries thanks though.
|

Atomic Hedgehog
Starcade Group Elemental Tide
0
|
Posted - 2013.08.17 02:34:00 -
[9] - Quote
Ydnari wrote:Quote: $characterID= "something";
$url = "https://api.eveonline.com/char/WalletJournal.xml.aspx?keyID=$keyid&Vcode=$vcode&characterID=$characterID";
Turn your error level reporting up further, you've misspelled the variable. Then delete this code and use PhealNG.
the typo there was only from typing it onto the forum, its actually spelled correctly in my script..if i manually post the api query, it returns the xml fine, thats not where im having the problem.
|

ItsmeHcK1
Kicked. Shadow Cartel
80
|
Posted - 2013.08.17 12:49:00 -
[10] - Quote
ItsmeHcK1 wrote:Also, the actual error might be helpful.
|
| |
|
| Pages: [1] :: one page |
| First page | Previous page | Next page | Last page |