<?php

require_once("db.php");

$idprod = $_GET['idprod'];
$tipo   = $_GET['tipo'];

// echo $idprod."#";

$query = "SELECT * FROM transacoes where idprod = '$idprod' AND tipo = '$tipo' ORDER BY data_hora desc LIMIT 0, 14 ";

$result = mysql_query($query) or die(mysql_error);

if(mysql_num_rows($result) > 0){
    while ($row = mysql_fetch_assoc($result)) {
        echo $row['data_hora'] 
        . "----------------------------------------------------------------------" ."R$ " . $row['valor']. ",00" . "#";   
    }
} else {
    echo "NULL";
}

?>