dbcon.php
<?php
$host="localhost";
$user="spring";
$password="1234";
$conn=mysql_connect($host, $user, $password);
mysql_select_db("web");
// if($conn==true){
//
// echo "MARIA DB에 연결 되었습니다.";
// }else{
//
// echo "MARIA DB에 연결 실패 하였습니다.";
// }
//
?>
list.php
<?php
include_once("dbcon.php");
$sql ="select * from guestbook order by idx desc";
$rs =mysql_query($sql);
echo "<table border='1' >";
echo
"<tr>
<th>번호</th>
<th>이름</th>
<th>내용</th>
<th>이메일</th>
<th>날짜</th>
</tr>
";
while($row = mysql_fetch_array($rs)){
echo "
<tr>
<td>$row[idx]</td>
<td>$row[name] </td>
<td>$row[content] </td>
<td>$row[email]</td>
<td>$row[post_date]</td>
</tr>";
}
mysql_close();
?>
댓글 ( 4)
댓글 남기기