php开发1.0

1.html网站页面

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        ul{
            list-style-type: none; /*清除无序列表前的小点*/
            width: auto;
            height: 50px;
            background: #3b3753;
            margin: 0px;
            padding-left: 20%;/*左边距,使li看起来在中间*/
            /*position: relative;*/
            text-align: center;
        }
        li{
            float: left;
            width: 130px;
            height: 100%;
            padding: 0px;
            margin-right: 1%;  /*两个li之间的距离*/
        }
        a:link,a:visited{ /*鼠标未点击和点击过时的样式*/
            display: block;
            color: #FFFFFF;
            background-color: #3b3753;
            text-align: center;
            line-height: 30px; /*li行高*/
            padding: 10px;
            text-decoration: none; /*去下划线*/
        }
        a:hover{ /*鼠标移动到点击位时的样式,active指点击过后的样式*/
            background-color: #111;
        }
    </style>
</head>
<body>
<div class="box">
    <div class="nav1">
        <!--横向导航栏-->
        <ul>
            <li><a href="sdfj.php"> 项目1 </a></li>
            <li><a href="index.php"> 首页 </a></li>
            <li><a href="#"> 项目3 </a></li>
            <li><a href="#"> 项目4 </a></li>
            <li><a href="#"> 项i目5 </a></li>
        </ul>
    </div>
    <div>

</body>
</html>

2.数据库的链接,及输出数据库的内容

<?php
$conn=mysqli_connect('localhost','root','cqh13322052748','fly');
$sql="select * from sdsadas ";
$result=mysqli_query($conn,$sql);
while($row=mysqli_fetch_array($result))
{
    echo $row['id'];
    echo $row['content'];echo "<br>";
}

?>

 

 3.get传参指定的数据库内容 

<?php
$conn=mysqli_connect('localhost','root','cqh13322052748','fly');
$i=$_GET['x'];
$sql="select * from sdsadas where id='$i' ";
$result=mysqli_query($conn,$sql);
while($row=mysqli_fetch_array($result))
{
    echo $row['id'];
    echo $row['content'];echo "<br>";
}

?>