<?=subject_sort_link('mb_id', '', 'desc')?> 부분좀 알려주세요.
member_list.php 파일을 복사하여 수정하여 쓰고 있습니다.
항목은 요..
################################################################
<tr bgcolor="#f0f0f0">
<td height="30">아이디</td>
<td height="30">이름</td>
<td height="30"><?=subject_sort_link('mb_id', '', 'desc')?>예약일</a></td>
<td height="30">휴대폰번호</td>
</tr>
################################################################
이렇게 항목을 설정되어 있습니다요...
여기서 "예약일"이 문제입니다요...
왜냐면 예약일 타이틀을 클릭하면 최근 일자로 소트시키고 싶어요..
그런데 member_list 파일이 member디비를 불러내서 보여주고 있는데요.. 이 예약일도 멤버디비에 있다면 얼마나 좋을까요?...ㅠㅠㅠ
그런데 이 예약일은 다른 디비 reserve 이라는 디비에 있거든요..ㅠㅠ 그래서 문제가 발생되네요...
즉 리스트는 아래와 같이 불러옵니다.
#####################################################
<?
for ($i=0; $row=sql_fetch_array($result); $i++) {
//예약일자 불러오기
// reserve 테이블에서 멤버 아이디가 같은 것 중에서 예약일자와 예약시간이 맨 마지막의 것을 1개 만 불러올것.
$reserve2=sql_query("select Ydate from g4_write_reserve where mb_id='$row[mb_id]' and DATE_FORMAT( CONCAT(Ydate,' ',Ytime) ,'%Y-%m-%d %H:%i:00') order by Ydate desc limit 1");
$row_late=sql_fetch_array($reserve2);
echo "<tr>
<td height=\"35\" align=center>$mb_id</td>
<td height=\"35\" align=center>$row[mb_name]</td>
<td height=\"35\" align=center>$row_late[Ydate]</td>
<td height=\"35\" align=center>$row[mb_hp]</td>
</tr>";
.
.
.
.
.
#################################################
여기서 "예약일"을 클릭하면 예약일(reserve 테이블에서 불러온 값으로) 소트 시킬 수있나요?
있다면 어찌해야 되는지요?
꼭 필요합니다..
좀 갈켜주세요..고수님들~~~
항목은 요..
################################################################
<tr bgcolor="#f0f0f0">
<td height="30">아이디</td>
<td height="30">이름</td>
<td height="30"><?=subject_sort_link('mb_id', '', 'desc')?>예약일</a></td>
<td height="30">휴대폰번호</td>
</tr>
################################################################
이렇게 항목을 설정되어 있습니다요...
여기서 "예약일"이 문제입니다요...
왜냐면 예약일 타이틀을 클릭하면 최근 일자로 소트시키고 싶어요..
그런데 member_list 파일이 member디비를 불러내서 보여주고 있는데요.. 이 예약일도 멤버디비에 있다면 얼마나 좋을까요?...ㅠㅠㅠ
그런데 이 예약일은 다른 디비 reserve 이라는 디비에 있거든요..ㅠㅠ 그래서 문제가 발생되네요...
즉 리스트는 아래와 같이 불러옵니다.
#####################################################
<?
for ($i=0; $row=sql_fetch_array($result); $i++) {
//예약일자 불러오기
// reserve 테이블에서 멤버 아이디가 같은 것 중에서 예약일자와 예약시간이 맨 마지막의 것을 1개 만 불러올것.
$reserve2=sql_query("select Ydate from g4_write_reserve where mb_id='$row[mb_id]' and DATE_FORMAT( CONCAT(Ydate,' ',Ytime) ,'%Y-%m-%d %H:%i:00') order by Ydate desc limit 1");
$row_late=sql_fetch_array($reserve2);
echo "<tr>
<td height=\"35\" align=center>$mb_id</td>
<td height=\"35\" align=center>$row[mb_name]</td>
<td height=\"35\" align=center>$row_late[Ydate]</td>
<td height=\"35\" align=center>$row[mb_hp]</td>
</tr>";
.
.
.
.
.
#################################################
여기서 "예약일"을 클릭하면 예약일(reserve 테이블에서 불러온 값으로) 소트 시킬 수있나요?
있다면 어찌해야 되는지요?
꼭 필요합니다..
좀 갈켜주세요..고수님들~~~
|
댓글을 작성하시려면 로그인이 필요합니다.
댓글 2개
회원 목록수가 20명이라면 20번 디비쿼리를 해야하니 얼마나 무식한 방법입니까?
조금만 바꾸면 아주 쉽게 서버 부하도 주지않고 출력 가능합니다
스킨폴더에 write_update.skin.php를 만들어서 아래 코드를 추가하면 출력이던 sort던 mb_1으로 해주면 됩니다
mb_1에 index를 추가해주면 더욱 좋을테고..
$mb_id=$w =='u' ? $write[mb_id] : $member[mb_id];
sql_query("update $g4[member_table] set mb_1='Ydate에 입력하는 날짜' where mb_id='$mb_id'");
그런후 g4_write_reserve 쿼리하는 부분 삭제해버리세요
아예 멤버디비에 저장을 시키라는 말씀이군요...