안녕하세요..자꾸 에러가나서요..
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년 전 | 1170 | ||
| 2129 |
ⓧ힘내세요
|
17년 전 | 2229 | |
| 2128 | 17년 전 | 2872 | ||
| 2127 | 17년 전 | 4055 | ||
| 2126 | 17년 전 | 3141 | ||
| 2125 | 17년 전 | 1404 | ||
| 2124 | 17년 전 | 1705 | ||
| 2123 | 17년 전 | 2235 | ||
| 2122 | 17년 전 | 1542 | ||
| 2121 | 17년 전 | 1714 | ||
| 2120 | 17년 전 | 2710 | ||
| 2119 | 17년 전 | 2134 | ||
| 2118 | 17년 전 | 1788 | ||
| 2117 |
아름다운세상
|
17년 전 | 4193 | |
| 2116 | 17년 전 | 3045 | ||
| 2115 | 17년 전 | 1433 | ||
| 2114 |
아름다운세상
|
17년 전 | 3562 | |
| 2113 | 17년 전 | 2791 | ||
| 2112 | 17년 전 | 2072 | ||
| 2111 | 17년 전 | 1285 | ||
| 2110 | 17년 전 | 2326 | ||
| 2109 | 17년 전 | 2063 | ||
| 2108 | 17년 전 | 1979 | ||
| 2107 |
휴전합시다
|
17년 전 | 1918 | |
| 2106 | 17년 전 | 1168 | ||
| 2105 |
|
17년 전 | 1871 | |
| 2104 | 17년 전 | 2925 | ||
| 2103 | 17년 전 | 1426 | ||
| 2102 | 17년 전 | 1668 | ||
| 2101 | 17년 전 | 1353 | ||
| 2100 | 17년 전 | 1597 | ||
| 2099 | 17년 전 | 1569 | ||
| 2098 | 17년 전 | 1443 | ||
| 2097 | 17년 전 | 2554 | ||
| 2096 | 17년 전 | 2321 | ||
| 2095 | 17년 전 | 2105 | ||
| 2094 | 17년 전 | 1415 | ||
| 2093 | 17년 전 | 2426 | ||
| 2092 | 17년 전 | 4251 | ||
| 2091 | 17년 전 | 2736 | ||
| 2090 | 17년 전 | 1658 | ||
| 2089 | 17년 전 | 1849 | ||
| 2088 | 17년 전 | 3223 | ||
| 2087 | 17년 전 | 2226 | ||
| 2086 | 17년 전 | 3820 | ||
| 2085 | 17년 전 | 1671 | ||
| 2084 | 17년 전 | 2265 | ||
| 2083 | 17년 전 | 2094 | ||
| 2082 | 17년 전 | 1610 | ||
| 2081 | 17년 전 | 2125 | ||
| 2080 |
letsgolee
|
17년 전 | 1921 | |
| 2079 | 17년 전 | 1957 | ||
| 2078 | 17년 전 | 3069 | ||
| 2077 | 17년 전 | 2143 | ||
| 2076 | 17년 전 | 1433 | ||
| 2075 | 17년 전 | 1454 | ||
| 2074 | 17년 전 | 2122 | ||
| 2073 | 17년 전 | 3202 | ||
| 2072 | 17년 전 | 2135 | ||
| 2071 |
휴전합시다
|
17년 전 | 1529 | |
| 2070 | 17년 전 | 4237 | ||
| 2069 | 17년 전 | 2029 | ||
| 2068 | 17년 전 | 3455 | ||
| 2067 | 17년 전 | 6026 | ||
| 2066 | 17년 전 | 1479 | ||
| 2065 |
letsgolee
|
17년 전 | 1651 | |
| 2064 | 17년 전 | 1232 | ||
| 2063 | 17년 전 | 1345 | ||
| 2062 |
vicky
|
17년 전 | 2872 | |
| 2061 | 17년 전 | 1908 | ||
| 2060 |
카프카07
|
17년 전 | 2592 | |
| 2059 | 17년 전 | 1301 | ||
| 2058 | 17년 전 | 3181 | ||
| 2057 | 17년 전 | 2161 | ||
| 2056 | 17년 전 | 2604 | ||
| 2055 | 17년 전 | 1405 | ||
| 2054 | 17년 전 | 1751 | ||
| 2053 | 17년 전 | 1145 | ||
| 2052 |
|
17년 전 | 1202 | |
| 2051 | 17년 전 | 1785 | ||
| 2050 | 17년 전 | 1225 | ||
| 2049 | 17년 전 | 4306 | ||
| 2048 | 17년 전 | 1504 | ||
| 2047 | 17년 전 | 2002 | ||
| 2046 |
카프카07
|
17년 전 | 7087 | |
| 2045 | 17년 전 | 1376 | ||
| 2044 | 17년 전 | 1893 | ||
| 2043 | 17년 전 | 3129 | ||
| 2042 | 17년 전 | 1220 | ||
| 2041 |
카프카07
|
17년 전 | 1979 | |
| 2040 | 17년 전 | 1152 | ||
| 2039 |
smilesol
|
17년 전 | 1847 | |
| 2038 | 17년 전 | 2144 | ||
| 2037 |
|
17년 전 | 2958 | |
| 2036 | 17년 전 | 1242 | ||
| 2035 |
|
17년 전 | 1330 | |
| 2034 |
ㅣ곰탱이ㅣ
|
17년 전 | 1554 | |
| 2033 |
|
17년 전 | 1226 | |
| 2032 | 17년 전 | 4351 | ||
| 2031 | 17년 전 | 3893 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기