안녕하세요..자꾸 에러가나서요..
my_sql 데이타 베이스에,,
revel
ㄴba_50day
....
...
..
ba_50day 라는 테이블에 날자를 20080506 형식으로 날자를 받아 저장하였습니다.
여러개 쌓인 날자값을 오늘 날자와 비교하여 오늘날자와 같은 날자만 뽑아
최근게시물 처럼 ... 그 리스트를 출력하여 화면에 뿌리고 싶습니다.
어떻게 해야할지 방법을 알려주세요
그누스킨중 생일자 출력을 응용해 봤는데... 않됩니다.
혹시 이코드에서 잘못된걸.. 찾을수 있을까요..
----------------------------------------------------------------
<?
include_once("./_common.php");
?>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="DDDDDD">
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="4" bgcolor="F5F5F5">
<tr>
<td align="center" valign="top" bgcolor="FFFFFF" style="padding:0px">
<table width=100% border=0 cellpadding=0 cellspacing=0><tr>
<td align=center>
<?
$today = getdate();
$ba50 = date("ymd"); //오늘 날짜(년월일)
//회원테이블에서 오늘이 생일인 회원 목록 추출
$sql = " select * from {$revel['ba_50day_table']} where substring(ba_50day,5,4) = '{$ba50}' ";
$result = sql_query($sql);
echo "<table width=94% border=0 cellpadding=0 cellspacing=0 bgcolor=#ffffff><tr>";
echo "<tr><td height=1 bgcolor=#ececec></td></tr>";
// echo "<tr><td height=1></td></tr>";
// echo "<tr><td height=2></td></tr>";
echo "<tr><td height=5></td></tr>";
echo "</table>";
echo "<marquee direction=down trueSpeed scrollamount='1' scrolldelay=50 onmouseover='this.stop();' onmouseout='this.start();' height=50 bgcolor=#ffffff><table width=190 border=0 cellpadding=0 cellspacing=0 bgcolor=#ffffff><tr>";
for ($i=0; $row=mysql_fetch_array($result); $i++) {
$ba50 = substr("$row[ba_50day]",-8,8);
if ($ba50 == $today) {
echo "<tr>";
echo "<td>";
echo "<table border=0 cellpadding=0 cellspacing=0><tr>";
echo "<td width=10></td>";
echo "<td title=$row[mb_id] valign=middle><img src='$g4[path]/include/birth/img/icl.gif' border=0>$row[mb_nick] 님</td>";
//echo "<td> $ba50 일</td>";
echo "</tr></table>";
echo "</td></tr>";
}
}
echo "<tr><td height=5></td></tr>";
echo "</table></marquee>";
?>
</td></tr>
<tr><td height=25 align=center>
<font color='#FF6600'>생일축하합니다!.</font>
</td></tr>
</table>
</td>
</td></tr>
</table>
</td></tr>
</table>
<table width="100%" cellpadding=0 cellspacing=0>
<tr><td height=5></td></tr>
</table>
------------------------------------------------------------------------------------------------
my_sql 데이타 베이스에,,
revel
ㄴba_50day
....
...
..
ba_50day 라는 테이블에 날자를 20080506 형식으로 날자를 받아 저장하였습니다.
여러개 쌓인 날자값을 오늘 날자와 비교하여 오늘날자와 같은 날자만 뽑아
최근게시물 처럼 ... 그 리스트를 출력하여 화면에 뿌리고 싶습니다.
어떻게 해야할지 방법을 알려주세요
그누스킨중 생일자 출력을 응용해 봤는데... 않됩니다.
혹시 이코드에서 잘못된걸.. 찾을수 있을까요..
----------------------------------------------------------------
<?
include_once("./_common.php");
?>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="DDDDDD">
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="4" bgcolor="F5F5F5">
<tr>
<td align="center" valign="top" bgcolor="FFFFFF" style="padding:0px">
<table width=100% border=0 cellpadding=0 cellspacing=0><tr>
<td align=center>
<?
$today = getdate();
$ba50 = date("ymd"); //오늘 날짜(년월일)
//회원테이블에서 오늘이 생일인 회원 목록 추출
$sql = " select * from {$revel['ba_50day_table']} where substring(ba_50day,5,4) = '{$ba50}' ";
$result = sql_query($sql);
echo "<table width=94% border=0 cellpadding=0 cellspacing=0 bgcolor=#ffffff><tr>";
echo "<tr><td height=1 bgcolor=#ececec></td></tr>";
// echo "<tr><td height=1></td></tr>";
// echo "<tr><td height=2></td></tr>";
echo "<tr><td height=5></td></tr>";
echo "</table>";
echo "<marquee direction=down trueSpeed scrollamount='1' scrolldelay=50 onmouseover='this.stop();' onmouseout='this.start();' height=50 bgcolor=#ffffff><table width=190 border=0 cellpadding=0 cellspacing=0 bgcolor=#ffffff><tr>";
for ($i=0; $row=mysql_fetch_array($result); $i++) {
$ba50 = substr("$row[ba_50day]",-8,8);
if ($ba50 == $today) {
echo "<tr>";
echo "<td>";
echo "<table border=0 cellpadding=0 cellspacing=0><tr>";
echo "<td width=10></td>";
echo "<td title=$row[mb_id] valign=middle><img src='$g4[path]/include/birth/img/icl.gif' border=0>$row[mb_nick] 님</td>";
//echo "<td> $ba50 일</td>";
echo "</tr></table>";
echo "</td></tr>";
}
}
echo "<tr><td height=5></td></tr>";
echo "</table></marquee>";
?>
</td></tr>
<tr><td height=25 align=center>
<font color='#FF6600'>생일축하합니다!.</font>
</td></tr>
</table>
</td>
</td></tr>
</table>
</td></tr>
</table>
<table width="100%" cellpadding=0 cellspacing=0>
<tr><td height=5></td></tr>
</table>
------------------------------------------------------------------------------------------------
댓글 3개
17년 전
where 뒤에 substring(ba_50day,5,4)를 쓰셨는데, 이건 월일만 비교하게 됩니다.
$ba50 = date("ymd");를 $ba50 = date("md");로 고치면 어떨까요?
$ba50 = date("ymd");를 $ba50 = date("md");로 고치면 어떨까요?
17년 전
연월일 모두 동일하게 비교후 뽑아야 합니다. 그럼 where 뒤에 substring(ba_50day,5,4)를 어떻게 수정해야 하나요 ?
17년 전
모두라면, substring을 안 하시면 됩니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 130 | 20년 전 | 4016 | ||
| 129 | 20년 전 | 2953 | ||
| 128 | 20년 전 | 3693 | ||
| 127 | 20년 전 | 3533 | ||
| 126 | 20년 전 | 3785 | ||
| 125 | 20년 전 | 8605 | ||
| 124 | 20년 전 | 2609 | ||
| 123 | 20년 전 | 3761 | ||
| 122 | 20년 전 | 3219 | ||
| 121 | 20년 전 | 2621 | ||
| 120 | 20년 전 | 2684 | ||
| 119 | 20년 전 | 2595 | ||
| 118 | 20년 전 | 2870 | ||
| 117 |
|
20년 전 | 3071 | |
| 116 | 20년 전 | 5334 | ||
| 115 | 20년 전 | 3936 | ||
| 114 | 20년 전 | 4985 | ||
| 113 | 20년 전 | 6228 | ||
| 112 | 20년 전 | 7334 | ||
| 111 | 21년 전 | 18446 | ||
| 110 | 21년 전 | 6887 | ||
| 109 | 21년 전 | 2896 | ||
| 108 | 21년 전 | 4151 | ||
| 107 |
prosper
|
21년 전 | 2511 | |
| 106 |
prosper
|
21년 전 | 4331 | |
| 105 |
아우겐나이스
|
21년 전 | 2928 | |
| 104 | 21년 전 | 2274 | ||
| 103 | 21년 전 | 2486 | ||
| 102 | 21년 전 | 2273 | ||
| 101 | 21년 전 | 2588 | ||
| 100 | 21년 전 | 1765 | ||
| 99 | 21년 전 | 1582 | ||
| 98 | 21년 전 | 1631 | ||
| 97 | 21년 전 | 2145 | ||
| 96 | 21년 전 | 1894 | ||
| 95 | 21년 전 | 2392 | ||
| 94 | 21년 전 | 3577 | ||
| 93 | 21년 전 | 1574 | ||
| 92 | 21년 전 | 1769 | ||
| 91 | 21년 전 | 3192 | ||
| 90 | 21년 전 | 2350 | ||
| 89 | 21년 전 | 3188 | ||
| 88 | 21년 전 | 2878 | ||
| 87 | 21년 전 | 3304 | ||
| 86 | 21년 전 | 5152 | ||
| 85 | 21년 전 | 2537 | ||
| 84 | 21년 전 | 4837 | ||
| 83 | 21년 전 | 2516 | ||
| 82 | 21년 전 | 3130 | ||
| 81 | 21년 전 | 7642 | ||
| 80 | 21년 전 | 3842 | ||
| 79 | 21년 전 | 3223 | ||
| 78 | 21년 전 | 4705 | ||
| 77 | 21년 전 | 2915 | ||
| 76 | 21년 전 | 6230 | ||
| 75 | 21년 전 | 4481 | ||
| 74 | 21년 전 | 5798 | ||
| 73 | 21년 전 | 3637 | ||
| 72 | 21년 전 | 5980 | ||
| 71 | 21년 전 | 3132 | ||
| 70 | 21년 전 | 2860 | ||
| 69 | 21년 전 | 2649 | ||
| 68 | 21년 전 | 2458 | ||
| 67 | 21년 전 | 2664 | ||
| 66 | 21년 전 | 2686 | ||
| 65 | 21년 전 | 3796 | ||
| 64 | 21년 전 | 2838 | ||
| 63 | 21년 전 | 2468 | ||
| 62 | 21년 전 | 2278 | ||
| 61 | 21년 전 | 3097 | ||
| 60 | 21년 전 | 3146 | ||
| 59 | 21년 전 | 2528 | ||
| 58 | 21년 전 | 2601 | ||
| 57 | 21년 전 | 2985 | ||
| 56 | 21년 전 | 2346 | ||
| 55 | 21년 전 | 2776 | ||
| 54 | 21년 전 | 2144 | ||
| 53 | 21년 전 | 2373 | ||
| 52 | 21년 전 | 2713 | ||
| 51 |
prosper
|
21년 전 | 2367 | |
| 50 |
prosper
|
21년 전 | 2183 | |
| 49 | 21년 전 | 2195 | ||
| 48 | 21년 전 | 2356 | ||
| 47 | 21년 전 | 1950 | ||
| 46 | 21년 전 | 1937 | ||
| 45 | 21년 전 | 2144 | ||
| 44 | 21년 전 | 2375 | ||
| 43 | 21년 전 | 4589 | ||
| 42 |
prosper
|
21년 전 | 2722 | |
| 41 |
prosper
|
21년 전 | 2124 | |
| 40 | 21년 전 | 2188 | ||
| 39 | 21년 전 | 2160 | ||
| 38 | 21년 전 | 2435 | ||
| 37 | 21년 전 | 2579 | ||
| 36 | 21년 전 | 1789 | ||
| 35 | 21년 전 | 4089 | ||
| 34 | 21년 전 | 3861 | ||
| 33 | 21년 전 | 3001 | ||
| 32 |
prosper
|
21년 전 | 2915 | |
| 31 | 21년 전 | 5303 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기