Skip to content

Commit

Permalink
Update full_index.php
Browse files Browse the repository at this point in the history
Refactor to use blockchain_transactions table.
  • Loading branch information
Taylor Warden committed Mar 2, 2016
1 parent a28e4bd commit dad77d6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions full_index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@
//Use a while loop to print each line by ID then append with the newline character

//assign SQL to a variable for query execution
$sql = "SELECT id, crypto_symbol, crypto_address, external_address, direction, timestamp, finished FROM coin_index;";
$sql = "SELECT id, crypto_symbol, crypto_address, external_address, is_inbound, rc_timestamp, finished, bc_blockhash, bc_amount, bc_txid FROM blockchain_transactions;";
//connect to the database, execute the $sql, store the returned array within $result
//script exits gracefully if connection cannot be established
$result = $conn->query($sql);

//if the returned array has data
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "id: " . $row["id"]. " - Crypto Symbol: " . $row["crypto_symbol"]. " - Cryptocurrency Address: " . $row["crypto_address"].
" - External Address: " . $row["external_address"].
" - Time-stamp: " . $row["timestamp"]. " - Direction: " . $row["direction"]. " - Finished: " . $row["finished"]. "<br />";
" - Time-stamp: " . $row["rc_timestamp"]. " - Is Inbound: " . $row["is_inbound"]. " - Finished: " . $row["finished"]. " - Blockhash: ". $row["bc_blockhash"]. " Amount: " . $row["bc_txid"]. " TxID: " . $row["bc_txid"]. "<br />";
}
} else {
//else there were no results, notify RC operator
Expand Down

0 comments on commit dad77d6

Please sign in to comment.