안녕하세요..자꾸 에러가나서요..
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을 안 하시면 됩니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 2130 | 17년 전 | 1190 | ||
| 2129 |
ⓧ힘내세요
|
17년 전 | 2246 | |
| 2128 | 17년 전 | 2878 | ||
| 2127 | 17년 전 | 4061 | ||
| 2126 | 17년 전 | 3147 | ||
| 2125 | 17년 전 | 1409 | ||
| 2124 | 17년 전 | 1708 | ||
| 2123 | 17년 전 | 2239 | ||
| 2122 | 17년 전 | 1548 | ||
| 2121 | 17년 전 | 1728 | ||
| 2120 | 17년 전 | 2725 | ||
| 2119 | 17년 전 | 2149 | ||
| 2118 | 17년 전 | 1801 | ||
| 2117 |
아름다운세상
|
17년 전 | 4208 | |
| 2116 | 17년 전 | 3050 | ||
| 2115 | 17년 전 | 1438 | ||
| 2114 |
아름다운세상
|
17년 전 | 3577 | |
| 2113 | 17년 전 | 2801 | ||
| 2112 | 17년 전 | 2080 | ||
| 2111 | 17년 전 | 1296 | ||
| 2110 | 17년 전 | 2337 | ||
| 2109 | 17년 전 | 2072 | ||
| 2108 | 17년 전 | 1993 | ||
| 2107 |
휴전합시다
|
17년 전 | 1926 | |
| 2106 | 17년 전 | 1173 | ||
| 2105 |
|
17년 전 | 1873 | |
| 2104 | 17년 전 | 2930 | ||
| 2103 | 17년 전 | 1435 | ||
| 2102 | 17년 전 | 1674 | ||
| 2101 | 17년 전 | 1358 | ||
| 2100 | 17년 전 | 1605 | ||
| 2099 | 17년 전 | 1579 | ||
| 2098 | 17년 전 | 1449 | ||
| 2097 | 17년 전 | 2569 | ||
| 2096 | 17년 전 | 2332 | ||
| 2095 | 17년 전 | 2116 | ||
| 2094 | 17년 전 | 1427 | ||
| 2093 | 17년 전 | 2440 | ||
| 2092 | 17년 전 | 4266 | ||
| 2091 | 17년 전 | 2754 | ||
| 2090 | 17년 전 | 1669 | ||
| 2089 | 17년 전 | 1860 | ||
| 2088 | 17년 전 | 3243 | ||
| 2087 | 17년 전 | 2237 | ||
| 2086 | 17년 전 | 3835 | ||
| 2085 | 17년 전 | 1682 | ||
| 2084 | 17년 전 | 2287 | ||
| 2083 | 17년 전 | 2110 | ||
| 2082 | 17년 전 | 1617 | ||
| 2081 | 17년 전 | 2129 | ||
| 2080 |
letsgolee
|
17년 전 | 1922 | |
| 2079 | 17년 전 | 1962 | ||
| 2078 | 17년 전 | 3078 | ||
| 2077 | 17년 전 | 2154 | ||
| 2076 | 17년 전 | 1445 | ||
| 2075 | 17년 전 | 1464 | ||
| 2074 | 17년 전 | 2136 | ||
| 2073 | 17년 전 | 3207 | ||
| 2072 | 17년 전 | 2145 | ||
| 2071 |
휴전합시다
|
17년 전 | 1537 | |
| 2070 | 17년 전 | 4253 | ||
| 2069 | 17년 전 | 2046 | ||
| 2068 | 17년 전 | 3471 | ||
| 2067 | 17년 전 | 6043 | ||
| 2066 | 17년 전 | 1489 | ||
| 2065 |
letsgolee
|
17년 전 | 1657 | |
| 2064 | 17년 전 | 1235 | ||
| 2063 | 17년 전 | 1353 | ||
| 2062 |
vicky
|
17년 전 | 2880 | |
| 2061 | 17년 전 | 1913 | ||
| 2060 |
카프카07
|
17년 전 | 2597 | |
| 2059 | 17년 전 | 1311 | ||
| 2058 | 17년 전 | 3188 | ||
| 2057 | 17년 전 | 2168 | ||
| 2056 | 17년 전 | 2615 | ||
| 2055 | 17년 전 | 1413 | ||
| 2054 | 17년 전 | 1762 | ||
| 2053 | 17년 전 | 1153 | ||
| 2052 |
|
17년 전 | 1212 | |
| 2051 | 17년 전 | 1796 | ||
| 2050 | 17년 전 | 1235 | ||
| 2049 | 17년 전 | 4321 | ||
| 2048 | 17년 전 | 1520 | ||
| 2047 | 17년 전 | 2019 | ||
| 2046 |
카프카07
|
17년 전 | 7101 | |
| 2045 | 17년 전 | 1392 | ||
| 2044 | 17년 전 | 1912 | ||
| 2043 | 17년 전 | 3141 | ||
| 2042 | 17년 전 | 1233 | ||
| 2041 |
카프카07
|
17년 전 | 1994 | |
| 2040 | 17년 전 | 1171 | ||
| 2039 |
smilesol
|
17년 전 | 1866 | |
| 2038 | 17년 전 | 2169 | ||
| 2037 |
|
17년 전 | 2980 | |
| 2036 | 17년 전 | 1258 | ||
| 2035 |
|
17년 전 | 1348 | |
| 2034 |
ㅣ곰탱이ㅣ
|
17년 전 | 1571 | |
| 2033 |
|
17년 전 | 1236 | |
| 2032 | 17년 전 | 4364 | ||
| 2031 | 17년 전 | 3912 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기