안녕하세요..자꾸 에러가나서요..
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을 안 하시면 됩니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7530 | 10년 전 | 829 | ||
| 7529 |
파랑새1597
|
10년 전 | 1253 | |
| 7528 |
파랑새1597
|
10년 전 | 1336 | |
| 7527 |
integrity7
|
10년 전 | 1423 | |
| 7526 | 10년 전 | 2448 | ||
| 7525 |
다빈치코드777
|
10년 전 | 1127 | |
| 7524 | 10년 전 | 1596 | ||
| 7523 | 10년 전 | 986 | ||
| 7522 |
|
10년 전 | 1014 | |
| 7521 |
blackkil
|
10년 전 | 1899 | |
| 7520 | 10년 전 | 1316 | ||
| 7519 |
Gaumi
|
10년 전 | 1096 | |
| 7518 | 10년 전 | 1507 | ||
| 7517 | 10년 전 | 843 | ||
| 7516 | 10년 전 | 1315 | ||
| 7515 | 10년 전 | 1432 | ||
| 7514 |
|
10년 전 | 4501 | |
| 7513 |
멋진남자임
|
10년 전 | 1143 | |
| 7512 |
다빈치코드777
|
10년 전 | 903 | |
| 7511 |
|
10년 전 | 3420 | |
| 7510 | 10년 전 | 1386 | ||
| 7509 | 10년 전 | 1164 | ||
| 7508 | 10년 전 | 731 | ||
| 7507 |
senseme
|
10년 전 | 775 | |
| 7506 |
멋진남자임
|
10년 전 | 1669 | |
| 7505 | 10년 전 | 4050 | ||
| 7504 | 10년 전 | 2176 | ||
| 7503 | 10년 전 | 1011 | ||
| 7502 | 10년 전 | 535 | ||
| 7501 | 10년 전 | 1464 | ||
| 7500 | 10년 전 | 1511 | ||
| 7499 | 10년 전 | 3425 | ||
| 7498 | 10년 전 | 1266 | ||
| 7497 |
dethos79
|
10년 전 | 2986 | |
| 7496 | 10년 전 | 2210 | ||
| 7495 | 10년 전 | 930 | ||
| 7494 |
CHAVO
|
10년 전 | 1167 | |
| 7493 | 10년 전 | 2675 | ||
| 7492 | 10년 전 | 1308 | ||
| 7491 | 10년 전 | 1520 | ||
| 7490 | 10년 전 | 2366 | ||
| 7489 | 10년 전 | 2135 | ||
| 7488 |
toptopon
|
10년 전 | 918 | |
| 7487 |
|
10년 전 | 1062 | |
| 7486 | 10년 전 | 3379 | ||
| 7485 | 10년 전 | 1334 | ||
| 7484 | 10년 전 | 1388 | ||
| 7483 | 10년 전 | 1045 | ||
| 7482 | 10년 전 | 678 | ||
| 7481 | 10년 전 | 871 | ||
| 7480 | 10년 전 | 1253 | ||
| 7479 | 10년 전 | 2626 | ||
| 7478 | 10년 전 | 1192 | ||
| 7477 |
멋진남자임
|
10년 전 | 1538 | |
| 7476 |
zeppeto
|
10년 전 | 1151 | |
| 7475 |
200점아빠
|
10년 전 | 935 | |
| 7474 | 10년 전 | 4022 | ||
| 7473 | 10년 전 | 1011 | ||
| 7472 |
나르시스1
|
10년 전 | 1261 | |
| 7471 | 10년 전 | 890 | ||
| 7470 | 10년 전 | 1310 | ||
| 7469 |
플라이SINJI
|
10년 전 | 1021 | |
| 7468 |
|
10년 전 | 582 | |
| 7467 |
|
10년 전 | 706 | |
| 7466 | 10년 전 | 1153 | ||
| 7465 | 10년 전 | 1204 | ||
| 7464 |
|
10년 전 | 1219 | |
| 7463 | 10년 전 | 1281 | ||
| 7462 |
진짜별사탕
|
10년 전 | 882 | |
| 7461 | 10년 전 | 968 | ||
| 7460 | 10년 전 | 3766 | ||
| 7459 |
멋진남자임
|
10년 전 | 1580 | |
| 7458 |
멋진남자임
|
10년 전 | 510 | |
| 7457 | 10년 전 | 936 | ||
| 7456 | 11년 전 | 786 | ||
| 7455 | 11년 전 | 2197 | ||
| 7454 | 11년 전 | 646 | ||
| 7453 | 11년 전 | 857 | ||
| 7452 |
중국어사이트제작
|
11년 전 | 521 | |
| 7451 | 11년 전 | 928 | ||
| 7450 | 11년 전 | 649 | ||
| 7449 |
울라라라우
|
11년 전 | 968 | |
| 7448 | 11년 전 | 1642 | ||
| 7447 |
멋진남자임
|
11년 전 | 528 | |
| 7446 | 11년 전 | 576 | ||
| 7445 |
네이비칼라
|
11년 전 | 1712 | |
| 7444 |
senseme
|
11년 전 | 1428 | |
| 7443 | 11년 전 | 1358 | ||
| 7442 | 11년 전 | 751 | ||
| 7441 |
멋진남자임
|
11년 전 | 1462 | |
| 7440 | 11년 전 | 932 | ||
| 7439 |
|
11년 전 | 787 | |
| 7438 |
|
11년 전 | 957 | |
| 7437 |
basement
|
11년 전 | 1054 | |
| 7436 |
잘살아보자
|
11년 전 | 1149 | |
| 7435 | 11년 전 | 1108 | ||
| 7434 | 11년 전 | 3802 | ||
| 7433 |
|
11년 전 | 2778 | |
| 7432 |
alexkim
|
11년 전 | 883 | |
| 7431 |
이웃집초보
|
11년 전 | 1329 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기