Commit bcaa09a9 by jackzhou

修改数据字段

parent 111aa20f
...@@ -113,8 +113,6 @@ ...@@ -113,8 +113,6 @@
<div class="fh5co-narrow-content"> <div class="fh5co-narrow-content">
<h1 class="fh5co-heading animate-box" data-animate-effect="fadeInLeft">卡顿日志输出</h1> <h1 class="fh5co-heading animate-box" data-animate-effect="fadeInLeft">卡顿日志输出</h1>
<div class="row row-bottom-padded-md"> <div class="row row-bottom-padded-md">
<?php <?php
// 处理增加操作的页面 // 处理增加操作的页面
......
...@@ -16,8 +16,23 @@ $isHandle = $_GET['isHandle']; ...@@ -16,8 +16,23 @@ $isHandle = $_GET['isHandle'];
$gitCommitHash = $_GET['gitCommitHash']; $gitCommitHash = $_GET['gitCommitHash'];
$gitCurrentBranch = $_GET['gitCurrentBranch']; $gitCurrentBranch = $_GET['gitCurrentBranch'];
$addtime = $_GET['addtime']; $addtime = $_GET['addtime'];
// 插入数据
mysqli_query($link,"INSERT INTO leakCanary (className,contentJson,modulePackage,isHandle,gitCommitHash,gitCurrentBranch,addtime) VALUES ('$className','$contentJson','$modulePackage','$isHandle','$gitCommitHash','$gitCurrentBranch','$addtime')") or die('添加数据出错:'.mysqli_error()); // 3. 从DBNAME中查询到news数据库,返回数据库结果集,并按照addtime降序排列
$sql = 'select className from leakCanary order by id desc;';
// 结果集
$result = mysqli_query($link, $sql) or die('添加数据出错:'.mysqli_error());
$newsNum=mysqli_num_rows($result);
$hasTitle=false;
for($i=0; $i<$newsNum; $i++){
$row = mysqli_fetch_assoc($result);
if($row['className'] === $className) {
$hasTitle=true;
}
}
if($hasTitle == false){
// 插入数据
mysqli_query($link,"INSERT INTO leakCanary (className,contentJson,modulePackage,isHandle,gitCommitHash,gitCurrentBranch,addtime) VALUES ('$className','$contentJson','$modulePackage','$isHandle','$gitCommitHash','$gitCurrentBranch','$addtime')") or die('添加数据出错:'.mysqli_error());
}
$result=array( $result=array(
'code'=>0, 'code'=>0,
......
...@@ -27,7 +27,7 @@ CREATE TABLE `leakCanary` ( ...@@ -27,7 +27,7 @@ CREATE TABLE `leakCanary` (
`isHandle` varchar(64) NOT NULL, `isHandle` varchar(64) NOT NULL,
`gitCommitHash` text NOT NULL, `gitCommitHash` text NOT NULL,
`gitCurrentBranch` text NOT NULL, `gitCurrentBranch` text NOT NULL,
`addtime` date NOT NULL, `addtime` datetime NOT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
...@@ -39,7 +39,7 @@ CREATE TABLE `carton` ( ...@@ -39,7 +39,7 @@ CREATE TABLE `carton` (
`isHandle` varchar(64) NOT NULL, `isHandle` varchar(64) NOT NULL,
`gitCommitHash` text NOT NULL, `gitCommitHash` text NOT NULL,
`gitCurrentBranch` text NOT NULL, `gitCurrentBranch` text NOT NULL,
`addtime` date NOT NULL, `addtime` datetime NOT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment