php新闻发布系统发布成功从数据库查询所有数据用表格显示出来03

当弹出发布成功对话框,点击确定按钮进入到
location.href='new_list.php'进入到new_list所执行的php代码
代码如下:
 
  
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/3/18
 * Time: 18:17
 * 新闻列表页面
 */
header("content-type:text/html;charset=utf8");
//  数据库名称
$conn = mysqli_connect("localhost", "root", "root", "mynews");
mysqli_set_charset($conn, 'utf8'); //设定字符集
//查询语句
$querySql = "select *from mynews.mynews";
//执行查询操作
$que = mysqli_query($conn, $querySql);
//print_r($que); 多维数组
?>
html>
<html>
<head>
    <title>新闻列表展示页面title>
    <link rel="stylesheet" href="new_list.css">
    <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
    <script src="http://cdn.bootcss.com/jquery/3.0.0/jquery.min.js">script>
    <script src="http://cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js">script>
head>

<body>

<div id="body" class="body container">
    <div class="row">

        <div class="col-md-2">div>
        <div class="col-md-8 divTable">

                <table class="table-striped" border="2" cellspacing="0">

                    <thead><h3>新闻内容展示页面h3>thead>
                    <div><a href="new.html">返回发布新闻a>div>
                    <tr>
                        <th>编号th>
                        <th>标题th>
                        <th>内容th>
                        <th>编辑文章th>
                        <th>发布时间th>
                    tr>
                    
                                        $row = mysqli_fetch_array($que);
                    // $row=mysqli_fetch_row($que);
                    //print_r($row);
                    while ($row = mysqli_fetch_array($que)) {
                        ?>


                        <tr>
                            <td>$row['_id'] ?>td>
                            <td>$row ['title'] ?>td>
                            <td>$row['content'] ?>td>
                            <td>
                                <a href="new_ed.php?id=$row['_id'] ?>">修改a>
                                <a href="new_del.php?id=$row['_id'] ?>">删除a>
                            td>
                            <td>$row['3'] ?>td>
                        tr>

                                            }
                    ?>

                table>
        div>
        
        <div class="col-md-2">div>
    div>
    
div>
body>
html>

//new_list.css代码如下
 
  
.body{
    background-color: rgba(128, 128, 128, 0.3);
    border: 1px solid #0000cc;
}

.divTable {
    width: 300px;
    border:2px  solid darkslateblue;
    margin: 5px auto;
    text-align: center;

}

//运行效果如下
 
 

你可能感兴趣的:(php新闻发布系统发布成功从数据库查询所有数据用表格显示出来03)