-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
29 lines (29 loc) · 833 Bytes
/
index.php
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
27
28
29
<?php
class MyDB extends SQLite3
{
function __construct()
{
$this->open('Bing.db');
}
}
$db = new MyDB();
if(!$db){
echo $db->lastErrorMsg();echo "Operation done successfully\n";
} else {
echo "Opened database successfully\n";
}
$sql ="SELECT * FROM sqlite_sequence WHERE name='Bing_info'";
$ret = $db->query($sql);
while($row = $ret->fetchArray(SQLITE3_ASSOC) ){
$max_row = $row['seq']; # 获取最大id值
}
$i = rand(1,$max_row); # 生成随机数
$sql ="SELECT * FROM Bing_info WHERE id='$i'";
$ret = $db->query($sql);
while($row = $ret->fetchArray(SQLITE3_ASSOC) ){
$URL_1920X1080_via_COS = $row['URL_1920x1080_via_COS'];
}
echo "Operation done successfully\n";
$db->close();
header("Location: $URL_1920X1080_via_COS");
?>