Commit c08c0072 by jackzhou

修改

parent ee765070
...@@ -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 carton (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 carton 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 carton (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,
......
...@@ -98,6 +98,7 @@ ...@@ -98,6 +98,7 @@
for($i=0; $i<$newsNum; $i++){ for($i=0; $i<$newsNum; $i++){
$row = mysqli_fetch_assoc($result); $row = mysqli_fetch_assoc($result);
echo "<tr>"; echo "<tr>";
echo "<div>编号:{$row['id']}</div>";
echo echo
" "
<div class=\"col-padding animate-box\" data-animate-effect=\"fadeInLeft\"> <div class=\"col-padding animate-box\" data-animate-effect=\"fadeInLeft\">
......
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