-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path数据表同步.php
More file actions
64 lines (58 loc) · 1.26 KB
/
Copy path数据表同步.php
File metadata and controls
64 lines (58 loc) · 1.26 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
$conn =@mysql_connect("localhost","root",'');
mysql_select_db('chonggu');
mysql_query("set names 'utf8'");
$flag=0;
print_r
if(@$_POST['name']=='delete')
{
$flag=1;
$sql = "delete from cpg.copy_case";
$que = mysql_query($sql);
if($que)
{
echo "<script>alert(\"恭喜你,删除成功!\");</script>";
}
}elseif(@$_POST['name']=='copy')
{
$flag=1;
echo $sql = "insert into cpg.copy_case2(`id`,`navid`,`title`,`thumb`,`content`,`create`) select `id`,`navid`,`title`,`thumb`,`content`,`create` from chonggu.cg_case";
$que = mysql_query($sql);
if($que)
{
echo "<script>alert(\"数据表同步成功\");</script>";
}
}
?>
<script type="text/javascript">
function beforesubmit(action)
{
var e = document.info;
if(action==1)
{
e.name.value='delete';
e.submit();
}else if(action==2)
{
e.name.value='copy';
e.submit();
}else
{
return false;
}
}
</script>
<html>
<head></head>
<body>
<?php
?>
<form method="post" name="info">
<input type="button" value="清空" onclick=beforesubmit(1)>
<input type="button" value="同步" onclick=beforesubmit(2)>
<input type="text" name="name" value="">
</form>
<?php
?>
</body>
</html>