These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

Simple PHP/MySQL site code

First post
Author
Dixon Cutter
Savvys Corp
#1 - 2013-12-09 23:46:30 UTC
Would someone be able to recommend me where to start here? I'd like to setup a simple PHP/MySQL site to pull and store API data in a DB. For example, wallet and transactions data for analysis. I'm not a big PHP dev, mostly a sysadmin, but I can craft up a site given fragments of code to work with.

I've seen a lot of stuff out there but it's either too complex (Element48) or outdated or contains too little information to go on. I'd like to develop a local version of a site that would display cashflow, do FIFO profit calcs, etc. but I need to start from the basics I guess. I know there are plenty helpful sites out there like N. E. A. T., but I also know that nothing is free in this world, and there's always potential for someone to use your data for their own gains. Thus my attempt to create my own.
Wafflehead
Garoun Investment Bank
Gallente Federation
#2 - 2013-12-09 23:53:03 UTC  |  Edited by: Wafflehead
Dixon Cutter wrote:
Would someone be able to recommend me where to start here? I'd like to setup a simple PHP/MySQL site to pull and store API data in a DB. For example, wallet and transactions data for analysis. I'm not a big PHP dev, mostly a sysadmin, but I can craft up a site given fragments of code to work with.

I've seen a lot of stuff out there but it's either too complex (Element48) or outdated or contains too little information to go on. I'd like to develop a local version of a site that would display cashflow, do FIFO profit calcs, etc. but I need to start from the basics I guess. I know there are plenty helpful sites out there like N. E. A. T., but I also know that nothing is free in this world, and there's always potential for someone to use your data for their own gains. Thus my attempt to create my own.


Here is a quick PHP script to pull and display the xml results from the wallet transactions
http://pastebin.com/xJ9g5jxy

For the database side you can use MySQL and store the data.
Here you can learn alot: http://www.w3schools.com/php/php_mysql_insert.asp

Regarding the actual calculations you will need to learn how to use arrays and how the FIFO calc works.

P.S - This would be better suited in the Technology Lab
Dixon Cutter
Savvys Corp
#3 - 2013-12-10 00:41:24 UTC  |  Edited by: Dixon Cutter
Wafflehead wrote:
Here is a quick PHP script to pull and display the xml results from the wallet transactions
http://pastebin.com/xJ9g5jxy

For the database side you can use MySQL and store the data.
Here you can learn alot: http://www.w3schools.com/php/php_mysql_insert.asp

Regarding the actual calculations you will need to learn how to use arrays and how the FIFO calc works.

P.S - This would be better suited in the Technology Lab


Thank you, Wafflehead! That's a good start!

If anyone else has any useful code snippets, that would be great!

P. S. I actually tried to post in the Technology forum, but it wouldn't let me. Not sure why.
Hel O'Ween
Men On A Mission
#4 - 2013-12-10 09:19:13 UTC
Dixon Cutter wrote:
P. S. I actually tried to post in the Technology forum, but it wouldn't let me. Not sure why.


Sometimes the forum software goes wonky ... there's no kind of "special access token" needed to access that part of EO's forums.

But if you have been there, you should have noticed the sticky called EVE API Tutorial, which might be of help to you.

Also, the most complete API reference out there is the Wiki over at eve-id.net.

EVEWalletAware - an offline wallet manager.

Wafflehead
Garoun Investment Bank
Gallente Federation
#5 - 2013-12-10 09:59:31 UTC
Dixon Cutter wrote:
Wafflehead wrote:
Here is a quick PHP script to pull and display the xml results from the wallet transactions
http://pastebin.com/xJ9g5jxy

For the database side you can use MySQL and store the data.
Here you can learn alot: http://www.w3schools.com/php/php_mysql_insert.asp

Regarding the actual calculations you will need to learn how to use arrays and how the FIFO calc works.

P.S - This would be better suited in the Technology Lab


Thank you, Wafflehead! That's a good start!

If anyone else has any useful code snippets, that would be great!

P. S. I actually tried to post in the Technology forum, but it wouldn't let me. Not sure why.


I think you have plenty on your hands if you are new to PHP & MySQL. If you are going to make a project, start by writing each step you are going to be creating.

Your first task I assume would be to walk through all the sell orders and record them, then you need to compare them against the buy orders and then the inventory of stock etc etc..
Jdestars
Stars Research systems Incorporation
#6 - 2013-12-10 10:08:08 UTC
check in the temple of Dev Eve Tools => wiki.eve-id.net
Wafflehead
Garoun Investment Bank
Gallente Federation
#7 - 2013-12-10 10:34:08 UTC
Jdestars wrote:
check in the temple of Dev Eve Tools => wiki.eve-id.net


Corrected: EVEDev
ISD Dosnix
ISD Community Communications Liaisons
ISD Alliance
#8 - 2013-12-10 13:43:33 UTC
Moved to EVE Technology Lab
Kind Regards
ISD Dosnix

[b]ISD Dosnix Lieutenant Community Communication Liasons (CCL) Interstellar Service Department[/b]

Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#9 - 2013-12-10 20:01:50 UTC
First suggestion:

Use yapeal, or phealng for handling your interactions with the API.

They're a little more complicated to use than getting the xml yourself, but take care of all the edge and error conditions.

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

Wafflehead
Garoun Investment Bank
Gallente Federation
#10 - 2013-12-11 18:06:16 UTC
Steve Ronuken wrote:
First suggestion:

Use yapeal, or phealng for handling your interactions with the API.

They're a little more complicated to use than getting the xml yourself, but take care of all the edge and error conditions.



Error handling is very easy when talking about EVE's API, there is built in error codes such as 'marketErrorCode' and 'walletErrorCode'. You just need to check before processing the data.

In this case using a library is good if you don't wanna learn PHP. However if you learn to correctly use the SimpleXML then don't use them.

People who use a yapeal or phealng think.. "oh look I can code..". No you cannot code you can just follow a guide and read the wiki.

Would these libraries help with, lets say YouTube API? eBay API?. No they wouldn't.

Again:
Just to mock something up to work with the eve library = Use libraries.
Actually want to learn PHP and want to use eve as a project = Don't use libraries