안녕하세요..자꾸 에러가나서요..
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을 안 하시면 됩니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7730 | 10년 전 | 1317 | ||
| 7729 | 10년 전 | 1174 | ||
| 7728 |
잘살아보자
|
10년 전 | 617 | |
| 7727 |
잘살아보자
|
10년 전 | 515 | |
| 7726 |
잘살아보자
|
10년 전 | 845 | |
| 7725 |
잘살아보자
|
10년 전 | 571 | |
| 7724 |
잘살아보자
|
10년 전 | 491 | |
| 7723 |
잘살아보자
|
10년 전 | 552 | |
| 7722 |
잘살아보자
|
10년 전 | 490 | |
| 7721 |
잘살아보자
|
10년 전 | 522 | |
| 7720 |
잘살아보자
|
10년 전 | 489 | |
| 7719 |
비긴어게인
|
10년 전 | 702 | |
| 7718 |
|
10년 전 | 2549 | |
| 7717 |
잘살아보자
|
10년 전 | 670 | |
| 7716 |
잘살아보자
|
10년 전 | 417 | |
| 7715 |
잘살아보자
|
10년 전 | 448 | |
| 7714 |
잘살아보자
|
10년 전 | 511 | |
| 7713 | 10년 전 | 1792 | ||
| 7712 | 10년 전 | 1730 | ||
| 7711 | 10년 전 | 1119 | ||
| 7710 | 10년 전 | 1410 | ||
| 7709 | 10년 전 | 1533 | ||
| 7708 | 10년 전 | 1473 | ||
| 7707 | 10년 전 | 866 | ||
| 7706 |
별지기천사
|
10년 전 | 581 | |
| 7705 | 10년 전 | 1086 | ||
| 7704 |
ICONdesignstudio
|
10년 전 | 642 | |
| 7703 | 10년 전 | 607 | ||
| 7702 |
|
10년 전 | 744 | |
| 7701 | 10년 전 | 1433 | ||
| 7700 | 10년 전 | 1116 | ||
| 7699 | 10년 전 | 587 | ||
| 7698 | 10년 전 | 1159 | ||
| 7697 | 10년 전 | 5183 | ||
| 7696 | 10년 전 | 674 | ||
| 7695 | 10년 전 | 1698 | ||
| 7694 | 10년 전 | 1084 | ||
| 7693 | 10년 전 | 1570 | ||
| 7692 | 10년 전 | 1316 | ||
| 7691 | 10년 전 | 836 | ||
| 7690 | 10년 전 | 1400 | ||
| 7689 | 10년 전 | 1028 | ||
| 7688 | 10년 전 | 635 | ||
| 7687 |
파랑새1597
|
10년 전 | 615 | |
| 7686 | 10년 전 | 866 | ||
| 7685 | 10년 전 | 1353 | ||
| 7684 | 10년 전 | 811 | ||
| 7683 | 10년 전 | 1125 | ||
| 7682 | 10년 전 | 1039 | ||
| 7681 | 10년 전 | 685 | ||
| 7680 | 10년 전 | 1000 | ||
| 7679 | 10년 전 | 521 | ||
| 7678 | 10년 전 | 752 | ||
| 7677 | 10년 전 | 654 | ||
| 7676 |
|
10년 전 | 960 | |
| 7675 |
|
10년 전 | 1196 | |
| 7674 | 10년 전 | 1061 | ||
| 7673 | 10년 전 | 767 | ||
| 7672 | 10년 전 | 1109 | ||
| 7671 | 10년 전 | 921 | ||
| 7670 | 10년 전 | 685 | ||
| 7669 |
mashmellow
|
10년 전 | 1242 | |
| 7668 | 10년 전 | 730 | ||
| 7667 | 10년 전 | 1028 | ||
| 7666 |
senseme
|
10년 전 | 670 | |
| 7665 | 10년 전 | 526 | ||
| 7664 | 10년 전 | 1909 | ||
| 7663 |
mixx애교
|
10년 전 | 991 | |
| 7662 | 10년 전 | 1058 | ||
| 7661 |
hkhkah
|
10년 전 | 801 | |
| 7660 | 10년 전 | 1076 | ||
| 7659 |
커네드커네드
|
10년 전 | 947 | |
| 7658 |
바람돌이팡
|
10년 전 | 688 | |
| 7657 | 10년 전 | 1177 | ||
| 7656 | 10년 전 | 1590 | ||
| 7655 | 10년 전 | 1006 | ||
| 7654 |
개발짜증나
|
10년 전 | 869 | |
| 7653 |
네이비칼라
|
10년 전 | 894 | |
| 7652 |
밥먹고합시다
|
10년 전 | 821 | |
| 7651 |
플라이SINJI
|
10년 전 | 1524 | |
| 7650 |
개발짜증나
|
10년 전 | 1430 | |
| 7649 | 10년 전 | 465 | ||
| 7648 |
이미영ㅇㅇ
|
10년 전 | 885 | |
| 7647 | 10년 전 | 457 | ||
| 7646 | 10년 전 | 828 | ||
| 7645 | 10년 전 | 2336 | ||
| 7644 | 10년 전 | 834 | ||
| 7643 |
|
10년 전 | 2885 | |
| 7642 | 10년 전 | 1531 | ||
| 7641 | 10년 전 | 1151 | ||
| 7640 |
개발짜증나
|
10년 전 | 479 | |
| 7639 |
|
10년 전 | 823 | |
| 7638 |
개발짜증나
|
10년 전 | 1147 | |
| 7637 | 10년 전 | 1566 | ||
| 7636 | 10년 전 | 2921 | ||
| 7635 | 10년 전 | 1713 | ||
| 7634 | 10년 전 | 1899 | ||
| 7633 | 10년 전 | 2364 | ||
| 7632 | 10년 전 | 3969 | ||
| 7631 |
|
10년 전 | 1559 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기