-
Notifications
You must be signed in to change notification settings - Fork 2
/
test2.php
28 lines (22 loc) · 826 Bytes
/
test2.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
<?php
exit;
try {
$dbh = new PDO('mysql:host=116.62.12.33;dbname=yuetao', 'root', 'yjb123456');
$dbh2 = new PDO('mysql:host=localhost;dbname=ytsmall', 'root', '123456');
foreach ($dbh->query('SELECT unionid,balance,coin FROM xx_member_wechat a JOIN xx_member b ON a.member = b.id WHERE unionid IS NOT NULL') as $row) {
$unionid = $row['unionid'];
$coin = intval($row['coin']);
$b = $row['balance'];
$sql = 'update hjmall_user set integral=integral+'.$coin .' , price=price+'.$b.' where wechat_union_id =\''.$unionid . '\'';
// var_dump($sql);exit;
foreach ($dbh2->query($sql) as $r2){
var_dump($r2);
}
echo 'over';
}
$dbh = null;
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
?>