-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathshow.php
More file actions
26 lines (24 loc) · 802 Bytes
/
show.php
File metadata and controls
26 lines (24 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
set_time_limit(0);
//start
//bitcoin-qt.exe -server -rest -rpcbind=127.0.0.1 -rpcuser=RPCuser -rpcpassword=RPCpasswd
//插入数据库
$db = new mysqli('localhost', 'root', 'root', 'btc');
$str = "0123456789ABCDEFG";
$q = isset($_GET['q']) ? $_GET['q'] : '';
echo $q."<br>";
$sum = 0;
for($i=0; $i<16; $i++)
{
echo $q.$str[$i].':';
$query = "SELECT count(*) FROM `btc` WHERE `key_hex` between \"".$q.$str[$i]."\" and \"".$q.$str[$i+1]."\"";
//exit;
$result = $db->query($query);
$res = mysqli_fetch_assoc($result);
//print_r($res);exit;
echo $res['count(*)'];
$sum = $sum + $res['count(*)'];
echo '<a href=show.php?q='.$q.$str[$i].'>IN</a><br/>';
}
echo "sum:".$sum;
$db->close(); //关闭一个数据库连接,这不是必要的,因为脚本执行完毕时会自动关闭连接