Latest Bitcoin transactions Php, Myqsl using json
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

I'm looking for a script to get the latest transactions in real time separated by lines showing the value sent by such an address , it is confirmed at the top and the total value of all committed transactions .

I found this solution in Ruby that can be changed to Php by a programmer

They must be stored in mysql query using the address as id, keeping the amounts sent and confirmed

Can you be more specific about that last sentence? If you do such a thing, you'll no longer be able to receive an status, because once an address is stored, it cannot be overridden. Instead, the query will throw an error.
feroldi almost 5 years ago
sure! will be two screens , the idea is that every page that is displayed on the screen can display the portfolio, along with qr and the latest transactions. also a space to show the total that this portfolio has received from committed transactions . each portfolio that receive should be kept in mysql with the transactions and the total as well as more portfolios are used each have their transaction history and total
scroll_lock almost 5 years ago
Okay, but why does an address need to be used as an id for the query?
feroldi almost 5 years ago
to fetch friendly urls using bitcoin address
scroll_lock almost 5 years ago
Okay, it's done. I've edited my solution.
feroldi almost 5 years ago
Hi thelostt, sorry for delay, ill test right now! Could you share the sql too please
scroll_lock almost 5 years ago
Hey, here you go:
feroldi almost 5 years ago
So, is my solution what you've asked for?
feroldi almost 5 years ago
awarded to feroldi

Crowdsource coding tasks.

1 Solution

Winning solution

php code

I made the php code to get transactions from an address. But I think I need to explain a little issue about making addresses to be ids in query.

Once you do so (set a new value with the address as id), you can't set a new one anymore. That is, if a new transaction, which corresponds to the same address, appears, query will break things and throw an error, because there's already such an id set.

With that in mind, you'll need to do something else to store it.



and there's a use example in database.php:

// Parses an address
$portfolio = TransactionParser('1Cvvr8AsCfbbVQ2xoWiFD1Gb2VRbGsEf28');

// Instances a new TransactionsDatabase to handle our database.
$trdb = new TransactionsDatabase($db, "DBNAME");

// Gets the 5 latest (array) transactions from database
$transactions = $trdb->get_latest(5);

// Parses a bunch of transactions from portfolio and adds them to database.

// Gets the latest transaction from database.
$transactions = $trdb->get_latest();

foreach($transactions as $row) {
    echo "{$row->Portfolio}: {$row->Date}, {$row->Amount}" . "<br>";
in a mysql database it can create two tables, one with key portfolios receivable transactions ( ids ) and the total that each has confirmed and unconfirmed . the other table with the transactions , confirmations of each transaction and the amount of bitcoisn confirmed in each transaction
scroll_lock almost 5 years ago
I'll see what I can do.
feroldi almost 5 years ago