안녕하세요..자꾸 에러가나서요..
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을 안 하시면 됩니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7430 |
|
11년 전 | 4947 | |
| 7429 | 11년 전 | 1780 | ||
| 7428 |
멋진남자임
|
11년 전 | 1174 | |
| 7427 |
sdflksdj2
|
11년 전 | 835 | |
| 7426 | 11년 전 | 1371 | ||
| 7425 | 11년 전 | 1394 | ||
| 7424 | 11년 전 | 1056 | ||
| 7423 |
SeungYeon
|
11년 전 | 566 | |
| 7422 | 11년 전 | 815 | ||
| 7421 |
sdflksdj2
|
11년 전 | 694 | |
| 7420 | 11년 전 | 974 | ||
| 7419 |
|
11년 전 | 1410 | |
| 7418 |
멋진남자임
|
11년 전 | 1447 | |
| 7417 | 11년 전 | 611 | ||
| 7416 |
senseme
|
11년 전 | 1239 | |
| 7415 | 11년 전 | 967 | ||
| 7414 | 11년 전 | 719 | ||
| 7413 | 11년 전 | 4853 | ||
| 7412 | 11년 전 | 4408 | ||
| 7411 |
holla
|
11년 전 | 903 | |
| 7410 | 11년 전 | 4255 | ||
| 7409 | 11년 전 | 3930 | ||
| 7408 | 11년 전 | 4274 | ||
| 7407 | 11년 전 | 5095 | ||
| 7406 | 11년 전 | 4737 | ||
| 7405 | 11년 전 | 4306 | ||
| 7404 | 11년 전 | 766 | ||
| 7403 | 11년 전 | 5689 | ||
| 7402 | 11년 전 | 1528 | ||
| 7401 |
|
11년 전 | 982 | |
| 7400 | 11년 전 | 2979 | ||
| 7399 |
멋진남자임
|
11년 전 | 925 | |
| 7398 |
파랑새1597
|
11년 전 | 2716 | |
| 7397 | 11년 전 | 2279 | ||
| 7396 |
basketball
|
11년 전 | 1382 | |
| 7395 | 11년 전 | 1620 | ||
| 7394 | 11년 전 | 937 | ||
| 7393 | 11년 전 | 2077 | ||
| 7392 | 11년 전 | 854 | ||
| 7391 |
잘살아보자
|
11년 전 | 5373 | |
| 7390 |
잘살아보자
|
11년 전 | 2234 | |
| 7389 |
잘살아보자
|
11년 전 | 3324 | |
| 7388 |
파랑새1597
|
11년 전 | 932 | |
| 7387 | 11년 전 | 1109 | ||
| 7386 |
프리랜서퍼블리셔
|
11년 전 | 974 | |
| 7385 | 11년 전 | 1575 | ||
| 7384 |
울라라라우
|
11년 전 | 896 | |
| 7383 | 11년 전 | 1564 | ||
| 7382 |
잘살아보자
|
11년 전 | 4237 | |
| 7381 |
잘살아보자
|
11년 전 | 2008 | |
| 7380 |
잘살아보자
|
11년 전 | 1951 | |
| 7379 |
잘살아보자
|
11년 전 | 5912 | |
| 7378 |
senseme
|
11년 전 | 1910 | |
| 7377 |
잘살아보자
|
11년 전 | 2755 | |
| 7376 | 11년 전 | 2423 | ||
| 7375 |
잘살아보자
|
11년 전 | 1055 | |
| 7374 |
잘살아보자
|
11년 전 | 3168 | |
| 7373 |
잘살아보자
|
11년 전 | 2487 | |
| 7372 |
잘살아보자
|
11년 전 | 5834 | |
| 7371 |
잘살아보자
|
11년 전 | 3472 | |
| 7370 |
잘살아보자
|
11년 전 | 1917 | |
| 7369 |
잘살아보자
|
11년 전 | 2177 | |
| 7368 |
ksdhtm56
|
11년 전 | 576 | |
| 7367 | 11년 전 | 1441 | ||
| 7366 | 11년 전 | 941 | ||
| 7365 | 11년 전 | 3555 | ||
| 7364 |
잘살아보자
|
11년 전 | 1404 | |
| 7363 |
잘살아보자
|
11년 전 | 1382 | |
| 7362 |
잘살아보자
|
11년 전 | 1520 | |
| 7361 | 11년 전 | 3607 | ||
| 7360 | 11년 전 | 3569 | ||
| 7359 | 11년 전 | 3388 | ||
| 7358 |
멋진남자임
|
11년 전 | 1040 | |
| 7357 | 11년 전 | 3422 | ||
| 7356 | 11년 전 | 2609 | ||
| 7355 | 11년 전 | 3204 | ||
| 7354 |
파랑새1597
|
11년 전 | 657 | |
| 7353 |
잘살아보자
|
11년 전 | 2432 | |
| 7352 |
잘살아보자
|
11년 전 | 2426 | |
| 7351 |
잘살아보자
|
11년 전 | 2485 | |
| 7350 |
잘살아보자
|
11년 전 | 1480 | |
| 7349 |
잘살아보자
|
11년 전 | 1973 | |
| 7348 |
잘살아보자
|
11년 전 | 1292 | |
| 7347 |
잘살아보자
|
11년 전 | 1086 | |
| 7346 |
멋진남자임
|
11년 전 | 1654 | |
| 7345 | 11년 전 | 1003 | ||
| 7344 | 11년 전 | 3882 | ||
| 7343 | 11년 전 | 3667 | ||
| 7342 | 11년 전 | 1295 | ||
| 7341 | 11년 전 | 2534 | ||
| 7340 |
|
11년 전 | 945 | |
| 7339 | 11년 전 | 1740 | ||
| 7338 | 11년 전 | 3355 | ||
| 7337 | 11년 전 | 3669 | ||
| 7336 | 11년 전 | 4608 | ||
| 7335 | 11년 전 | 984 | ||
| 7334 | 11년 전 | 1543 | ||
| 7333 | 11년 전 | 2949 | ||
| 7332 |
|
11년 전 | 1120 | |
| 7331 |
KeePin뽁이
|
11년 전 | 1109 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기