안녕하세요..자꾸 에러가나서요..
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을 안 하시면 됩니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 1730 | 17년 전 | 1176 | ||
| 1729 | 17년 전 | 1593 | ||
| 1728 | 17년 전 | 1668 | ||
| 1727 | 17년 전 | 1809 | ||
| 1726 | 17년 전 | 2946 | ||
| 1725 | 17년 전 | 2081 | ||
| 1724 |
|
17년 전 | 1766 | |
| 1723 |
끝없는사랑
|
17년 전 | 2099 | |
| 1722 |
끝없는사랑
|
17년 전 | 1805 | |
| 1721 | 17년 전 | 3340 | ||
| 1720 | 17년 전 | 1523 | ||
| 1719 | 17년 전 | 1645 | ||
| 1718 |
사랑합니다
|
17년 전 | 1362 | |
| 1717 | 17년 전 | 2177 | ||
| 1716 | 17년 전 | 3130 | ||
| 1715 |
|
17년 전 | 2268 | |
| 1714 |
|
17년 전 | 1723 | |
| 1713 | 17년 전 | 2973 | ||
| 1712 | 17년 전 | 4419 | ||
| 1711 | 17년 전 | 1735 | ||
| 1710 | 17년 전 | 3235 | ||
| 1709 |
jeans
|
17년 전 | 1562 | |
| 1708 |
|
17년 전 | 3472 | |
| 1707 | 17년 전 | 5833 | ||
| 1706 |
|
17년 전 | 1413 | |
| 1705 |
|
17년 전 | 2150 | |
| 1704 | 17년 전 | 1782 | ||
| 1703 |
심심맨닷컴
|
17년 전 | 1522 | |
| 1702 | 17년 전 | 2412 | ||
| 1701 |
|
17년 전 | 2616 | |
| 1700 | 17년 전 | 1588 | ||
| 1699 | 17년 전 | 2677 | ||
| 1698 |
RedRiverFisher
|
17년 전 | 3163 | |
| 1697 |
심심맨닷컴
|
17년 전 | 1517 | |
| 1696 |
eclub
|
17년 전 | 1932 | |
| 1695 | 17년 전 | 3838 | ||
| 1694 |
깜장고무신
|
17년 전 | 4471 | |
| 1693 |
stuartkim
|
17년 전 | 1867 | |
| 1692 |
stuartkim
|
17년 전 | 1720 | |
| 1691 |
|
17년 전 | 2660 | |
| 1690 | 17년 전 | 1841 | ||
| 1689 | 17년 전 | 3927 | ||
| 1688 | 17년 전 | 1634 | ||
| 1687 | 16년 전 | 1917 | ||
| 1686 |
|
17년 전 | 2251 | |
| 1685 | 17년 전 | 2103 | ||
| 1684 |
|
17년 전 | 3562 | |
| 1683 |
leeLook
|
17년 전 | 1580 | |
| 1682 | 17년 전 | 2649 | ||
| 1681 | 17년 전 | 1630 | ||
| 1680 | 17년 전 | 1900 | ||
| 1679 | 17년 전 | 7416 | ||
| 1678 | 17년 전 | 1992 | ||
| 1677 | 17년 전 | 4083 | ||
| 1676 | 17년 전 | 2414 | ||
| 1675 | 17년 전 | 2423 | ||
| 1674 | 17년 전 | 2142 | ||
| 1673 | 17년 전 | 2192 | ||
| 1672 | 17년 전 | 2614 | ||
| 1671 | 17년 전 | 3206 | ||
| 1670 | 17년 전 | 5318 | ||
| 1669 |
플래시007
|
17년 전 | 2770 | |
| 1668 |
|
17년 전 | 2690 | |
| 1667 | 17년 전 | 2542 | ||
| 1666 |
|
17년 전 | 1789 | |
| 1665 | 17년 전 | 2196 | ||
| 1664 | 17년 전 | 5300 | ||
| 1663 |
|
17년 전 | 3011 | |
| 1662 |
|
17년 전 | 2574 | |
| 1661 |
|
17년 전 | 3249 | |
| 1660 |
|
17년 전 | 2464 | |
| 1659 |
|
17년 전 | 2824 | |
| 1658 | 17년 전 | 5863 | ||
| 1657 | 17년 전 | 2622 | ||
| 1656 |
Piece
|
17년 전 | 2017 | |
| 1655 |
|
17년 전 | 2645 | |
| 1654 | 17년 전 | 1470 | ||
| 1653 | 17년 전 | 9790 | ||
| 1652 | 17년 전 | 4446 | ||
| 1651 | 17년 전 | 3276 | ||
| 1650 | 17년 전 | 1803 | ||
| 1649 | 17년 전 | 3597 | ||
| 1648 | 17년 전 | 2278 | ||
| 1647 | 17년 전 | 3722 | ||
| 1646 | 17년 전 | 5172 | ||
| 1645 | 17년 전 | 3822 | ||
| 1644 | 17년 전 | 2668 | ||
| 1643 | 17년 전 | 2931 | ||
| 1642 | 17년 전 | 2440 | ||
| 1641 | 17년 전 | 2776 | ||
| 1640 |
porgy
|
17년 전 | 1894 | |
| 1639 | 17년 전 | 3429 | ||
| 1638 |
컴퓨터기술자
|
17년 전 | 2129 | |
| 1637 |
|
17년 전 | 2256 | |
| 1636 | 17년 전 | 2072 | ||
| 1635 | 17년 전 | 3041 | ||
| 1634 |
귀여운현호
|
17년 전 | 1990 | |
| 1633 |
태양의서쪽
|
17년 전 | 2659 | |
| 1632 | 17년 전 | 3861 | ||
| 1631 | 17년 전 | 4560 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기