데이터베이스 관련/PHP | HTML

프로젝트 1 [메인화면/매칭목록/PHP]

CE : 하랑 2022. 6. 28. 15:47

 

 

매칭목록

 

 

 

 

코드

<PHP count.php>

<style>
 table{border-collapse: collapse;
    text-align: center;
    line-height: 1.5;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    margin: auto;}
    th{ width: 150px;
    padding: 10px;
    font-weight: bold;
    vertical-align: top;
    color: rgb(255, 77, 46),;
    background: rgb(255, 155, 47);
    margin: 20px 10px;}
    td{  width: 350px;
    padding: 10px;
    vertical-align: top;}
    a{text-decoration:none}

    h2 { 
        color: linear-gradient(to left, rgb(255, 77, 46), rgb(255, 155, 47));
        text-align: center; }

</style>

<br>
<h2>X X 중고 매칭목록</h2>
<br>
<table><tr>
    <th>No</th><th>제목</th><th>작성자</th><th>작성일</th><th>조회수</th><th>거래매칭</th><th><th><th><a href="togather.php?id=<?=$_GET['id']?>">메인메뉴</a></th></th>

    <?php
   $id2=$_GET['id'];
   $connect=mysqli_connect("localhost","root","000000", "used");
   $sqlrec="select * from board where count='1'";
   $info=mysqli_query($connect,$sqlrec);
   while($i=mysqli_fetch_array($info))
   {
    echo "<tr>";
	echo "<td> $i[no] </td>";
    echo "<td> <a href='detail.php?title=$i[title]'> $i[title] </a></td>";
	echo "<td> $i[id2] </td>";
	echo "<td> $i[regdate] </td>";
	echo "<td> $i[hits] </td>";
    echo "<td> <button><a href='star.php?id=$id2'>매칭신청</a></button></td>";
    echo "<td>매칭완료 </td>";
	echo "</tr>";}
mysqli_close($connect);
?>