|
|
|
19년 전
|
조회 1,674
|
|
|
|
19년 전
|
조회 1,585
|
|
|
|
19년 전
|
조회 1,720
|
|
|
|
19년 전
|
조회 1,558
|
|
|
|
19년 전
|
조회 1,744
|
|
|
|
19년 전
|
조회 2,521
|
|
|
|
19년 전
|
조회 1,536
|
|
|
|
19년 전
|
조회 2,096
|
|
|
|
19년 전
|
조회 1,633
|
|
|
|
19년 전
|
조회 1,542
|
|
|
|
19년 전
|
조회 1,819
|
|
|
|
19년 전
|
조회 1,546
|
|
|
|
19년 전
|
조회 1,691
|
|
|
|
19년 전
|
조회 1,820
|
|
|
|
19년 전
|
조회 1,705
|
|
|
|
19년 전
|
조회 1,535
|
|
|
|
19년 전
|
조회 3,282
|
|
|
|
19년 전
|
조회 1,612
|
|
|
|
19년 전
|
조회 1,877
|
|
|
|
19년 전
|
조회 1,531
|
댓글 6개
<tr>
<td>라</td>
<td>박</td>
</tr>
<tr>
<td>이</td>
<td>김</td>
</tr>
</table>
글이 100개가 되도 2열로 출력되도록..
<?
include_once('m_common.php');
go_main_head($m_table='test') // 사이트 머리말을 db에서 불러온다.
go_main_left($m_table='');//원하는 좌측메뉴를 db에서 불러온다.
$cat_list = list_show($mta='g4_write_test');// 게시판에서 값을불러왔다고 가정
//한열을 자신이 원하는 배열방식으로 한다
foreach($cat_list as $row)// 각각의column 변화를 자신이 원하는 방향으로 디자인한다.
{
foreach($cat_list as $data)//각각의column 배치를 원하는 방향으로 한다.
{
echo $row[wr_1];
echo $row[wr-2];
echo '<br>';
echo $data[wr_3];
echo $data[wr_4];
}
}
go_main_footer();//꼬리말을 불러온다.
?>
<?
//m_common.php 에 포함된 함수들
//원하는 db table 호출
function list_show($mta)
{
// 테이터베이스에 원하는 숫자를 불러온다
$conn = db_connect();
$query = "select * from $mta";
$result = @$conn->query($query);
if (!$result)
return false;
$num_cats = @$result->num_rows;
if ($num_cats ==0)
return false;
$result = db_array($result);
return $result;
}
//호출된 column 을 array
function db_array($result)
{
$res_array = array();
for ($count=0; $row = $result->fetch_assoc(); $count++)
$res_array[$count] = $row;
return $res_array;
}
//db connect
function db_connect()
{
global $mysql_host;
global $mysql_user;
global $mysql_password;
global $mysql_db;
$result = new mysqli($mysql_host,$mysql_user,$mysql_password,'$mysql_db');
if (!$result)
return false;
$result->autocommit(TRUE);
return $result;
}
?>