I need to extract certain data from external json into mysql. After decoding my json looks like this: Array ( [key1] => 1 [key2] => [key3] => Array (  => Array ( [Id] => x1 [TimeStamp] =>y1 [Quantity] => z1 [Price] => q1 [Total] => w1 [FillType] =>e1 [OrderType] =>r1 )  => Array ( [Id] =>x2 [TimeStamp] => y2 [Quantity] => z2 [Price] => q2 [Total] => w1 [FillType] => e1 [OrderType] => r2 )  => Array .....and so on. I need to upload to my mysql three keys/values for each transaction, that is 'ID', 'TimeStamp', and 'Total'. I want to update that database every 5 minutes so that only data with newer 'TimeStamp' are added. Then I need to check the combined value of 'total' for the last 15 minutes, last (30-15) minutes, and value of 'total' for last 120 minutes divided by 8.
Hello, I send you some more info about what I need.
I want to make sure we understand eachother.
I download data from external server. It comes as json.
After after get_file_contents and json_decode true i receive nested arrays, which after print_r looks this way:
Array ( [success] => 1 [message] => [result] => Array (  => Array ( [Id] => 111745476 [TimeStamp] => 2017-12-05T19:50:58.19 [Quantity] => 1.2 [Price] => 0.00857242 [Total] => 0.0102869 [FillType] => PARTIAL_FILL [OrderType] => SELL )  => Array ( [Id] => 111745427 [TimeStamp] => 2017-12-05T19:50:56.113 [Quantity] => 0.10285719 [Price] => 0.0085831 [Total] => 0.00088283 [FillType] => FILL [OrderType] => BUY )  => Array ( [Id] => 111745412 [TimeStamp] => 2017-12-05T19:50:54.787 [Quantity] => 0.41726852 [Price] => 0.00858651 [Total] => 0.00358288 [FillType] => FILL [OrderType] => SELL )  => Array ( [Id] => 111745187 [TimeStamp] => 2017-12-05T19:50:46.83 [Quantity] => 19.13589601 [Price] => 0.00859 [Total] => 0.16437734 [FillType] => FILL [OrderType] => BUY )
and that is just a tiny part. I want to extract values from Id, TimeStamp and Total, where , ,  are transactions on crypto exchange.
Then I want these to be transfered to mysql database every 5 minutes, but only with transactions that are newer (have bigger Id), so the old stay and new are added.
I use Bittrex exchange. You can see API here: https://bittrex.com/home/api
I will be using getmarkethistory with parameters
code looks like this
$uri='https://bittrex.com/api/v1.1/public/getmarkethistory?market=BTC-LTC'; that is Bitcoin-Litecoin market history
$ch = curl_init($uri);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('apisign:'.$sign));
$execResult = curl_exec($ch);
$obj = json_decode($execResult);
I will provide with apikey and apisecret if we come to an agreement.
My mysql database is called Bittrex. In that database there are tables with cryptocoin pairs. That is btc-ltc table, btc-xxx table, btc-yyy table and so on.
Each table has colums named Id, TableStamp and Total, where the ids, timestamps and totals for each transaction encoded in json should go.
I will need help with what type, atributes, and defaults should every column have (as for know Id is int, TimeStamp is timestamp NULL, and Total is decimal)
Next step is to summarize 'Total' values for last 15 minutes (let's call it A), for period between 30 and 15 minutes ago(let's call it B),
and average value for 15minute periods in last 2,5hours (2,5hours ago to 0.5 hours ago) - that's C
The new part I did not write about before is that if B is at least 3 times bigger than C, and A is bigger that B I want php to echo timestamp when 'if' was true and name of the pair of currencies.
For example: 2017-12-05T19:50:44.99 BTC-LTC. I want it stay on www page until restart (or just forever if its easier to do)
Additionally I want that to be sent to my FBmessenger.
I want to track more than 100 pairs of currencies. I don't need you to prepare all of those. I just need one pair, than I will copy/paste the code and
make necessary changes in json url, function name (is it a good idea to make a function called for example BTC-LTC? This way the function name could be echoed in messages?), table names and so on.
And last part: if it's possible I would like four values that is A (15 minutes), B (period between 30 and 15 minutes ago), C (2,5hours ago to 0.5 hours ago), and D(at lease X times bigger)
to be editable like a constant, same one for every function, so somewhere at the top of the php code.
I will run it on localhost.
Please feel free to ask questions.
Hello,client I'm interested in your job This is php script job. I'm expert of script I have built many php scripts. I can do in 1 day Please discuss more details via chat Thanks Relevant Skills and Experience Plus
39 freelance font une offre moyenne de $132 pour ce travail
HI There, I can assist you with "PHP nested arrays to mysql", I have experience working with "similar Development". Let's have a quick chat to discuss it further. Relevant Skills and Experience I have been in this "P Plus
I can create PHP script that will work like you want (parsing JSON, uploading it into MySQL, calculating totals etc) in less than 6 hours. Relevant Skills and Experience I have worked on similar projects dozens of tim Plus
sir pm me im good in php i can finish this job fst Relevant Skills and Experience php Proposed Milestones $90 USD - price
I am a good web developer. I can do it. Relevant Skills and Experience php, json Proposed Milestones $155 USD - re
hi i read the requirement just one thing can you explain the 5 minute scenario which you are saying in the description Relevant Skills and Experience wordpress php Proposed Milestones $155 USD - final
Hello, I am a senior web developer , with over 10 years of experiences. I am master of mysql database management and php script. I can help you asap. [url removed, login to view] Relevant Skills and Experience I am master Plus
Five star technologies passion Relevant Skills and Experience I have 7 years experience with your project skills i'm specialist with your project project flow sir Proposed Milestones $120 USD - work Hi sir can you p Plus
Hi there, My name is Manish. I would like to write PHP script to save error and do the calculations over it. please get in touch to discuss more. Relevant Skills and Experience I have good proficiency in PHP, mysql Pl Plus
Hello there i am a professional and have extensive experience with these type of tasks, can you please pm me right now? i am waiting Thanks regards Relevant Skills and Experience php,mysql,json Proposed Milestones $1 Plus
Hello Sir/mam, As a Web & App development company we have investigate your project and find that we can do this but first i would like to show u my exp. Relevant Skills and Experience Our specialities: - iOS/Android d Plus
Please send me details. ......................................... Stay tuned, I'm still working on this proposal.
I have 100% job completion rate:) I have above 5yr of experience in Web Development & Designing, Web application development. Relevant Skills and Experience My strengths are in PHP, Codeigniter, Laravel, Wordpress, M Plus
We are passionate team of developers. Till now we have competed in the local market and now we are hitting to the online market as we want to expose our skills and expertise to the another level. Relevant Skills and E Plus
I am php mysql expert with 4 years of experience also have got good hold on json data posting to database table. lets start. Thank you. Relevant Skills and Experience php mysql - 4 years. Proposed Milestones $8 Plus
Hello I seen your array code as well description and we will done your issue ASAP, so can you come on chat and lets it star? Relevant Skills and Experience We have more the 8 years of working experience on web/mobile Plus