안녕하세요..자꾸 에러가나서요..
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을 안 하시면 됩니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 1930 | 17년 전 | 2996 | ||
| 1929 | 17년 전 | 1873 | ||
| 1928 | 17년 전 | 3987 | ||
| 1927 | 17년 전 | 1401 | ||
| 1926 |
지엔소프트
|
17년 전 | 1117 | |
| 1925 |
보드타는찌니
|
17년 전 | 1229 | |
| 1924 |
choijinhee
|
17년 전 | 1110 | |
| 1923 | 17년 전 | 1370 | ||
| 1922 | 17년 전 | 1736 | ||
| 1921 | 17년 전 | 2335 | ||
| 1920 | 17년 전 | 2412 | ||
| 1919 | 17년 전 | 1415 | ||
| 1918 | 17년 전 | 1161 | ||
| 1917 | 17년 전 | 2430 | ||
| 1916 | 17년 전 | 2856 | ||
| 1915 |
|
17년 전 | 3224 | |
| 1914 | 17년 전 | 3166 | ||
| 1913 | 17년 전 | 2322 | ||
| 1912 | 17년 전 | 3745 | ||
| 1911 | 17년 전 | 3172 | ||
| 1910 | 17년 전 | 5494 | ||
| 1909 | 17년 전 | 2646 | ||
| 1908 | 17년 전 | 1850 | ||
| 1907 | 17년 전 | 1931 | ||
| 1906 | 17년 전 | 1766 | ||
| 1905 | 17년 전 | 1697 | ||
| 1904 | 17년 전 | 2760 | ||
| 1903 | 17년 전 | 1879 | ||
| 1902 | 17년 전 | 1568 | ||
| 1901 | 17년 전 | 2060 | ||
| 1900 |
stuartkim
|
17년 전 | 1123 | |
| 1899 | 17년 전 | 1658 | ||
| 1898 | 17년 전 | 2870 | ||
| 1897 | 17년 전 | 2110 | ||
| 1896 | 17년 전 | 1803 | ||
| 1895 | 17년 전 | 2021 | ||
| 1894 | 17년 전 | 1310 | ||
| 1893 | 17년 전 | 1701 | ||
| 1892 | 17년 전 | 1206 | ||
| 1891 | 17년 전 | 1766 | ||
| 1890 | 17년 전 | 1793 | ||
| 1889 | 17년 전 | 1034 | ||
| 1888 | 17년 전 | 3134 | ||
| 1887 | 17년 전 | 4309 | ||
| 1886 | 17년 전 | 2453 | ||
| 1885 | 17년 전 | 7455 | ||
| 1884 | 17년 전 | 3821 | ||
| 1883 | 17년 전 | 4153 | ||
| 1882 | 17년 전 | 2413 | ||
| 1881 | 17년 전 | 2877 | ||
| 1880 | 17년 전 | 3624 | ||
| 1879 | 17년 전 | 3995 | ||
| 1878 | 17년 전 | 3156 | ||
| 1877 | 17년 전 | 3140 | ||
| 1876 | 17년 전 | 3287 | ||
| 1875 | 17년 전 | 2455 | ||
| 1874 | 17년 전 | 2051 | ||
| 1873 | 17년 전 | 3098 | ||
| 1872 | 17년 전 | 3246 | ||
| 1871 | 17년 전 | 4603 | ||
| 1870 | 17년 전 | 1577 | ||
| 1869 | 17년 전 | 2609 | ||
| 1868 | 17년 전 | 2683 | ||
| 1867 | 17년 전 | 1895 | ||
| 1866 | 17년 전 | 2211 | ||
| 1865 | 17년 전 | 1823 | ||
| 1864 | 17년 전 | 2364 | ||
| 1863 | 17년 전 | 3766 | ||
| 1862 | 17년 전 | 3881 | ||
| 1861 | 17년 전 | 2076 | ||
| 1860 | 17년 전 | 1352 | ||
| 1859 | 17년 전 | 1490 | ||
| 1858 |
|
17년 전 | 1633 | |
| 1857 | 17년 전 | 1618 | ||
| 1856 |
보드타는찌니
|
17년 전 | 1377 | |
| 1855 | 17년 전 | 1522 | ||
| 1854 |
|
17년 전 | 1341 | |
| 1853 | 17년 전 | 1834 | ||
| 1852 | 17년 전 | 2740 | ||
| 1851 | 17년 전 | 1836 | ||
| 1850 |
|
17년 전 | 1383 | |
| 1849 |
|
17년 전 | 1671 | |
| 1848 |
|
17년 전 | 2318 | |
| 1847 | 17년 전 | 1939 | ||
| 1846 |
은사시나무
|
17년 전 | 1254 | |
| 1845 |
갈색야생마
|
17년 전 | 5894 | |
| 1844 |
갈색야생마
|
17년 전 | 3275 | |
| 1843 |
갈색야생마
|
17년 전 | 3172 | |
| 1842 |
갈색야생마
|
17년 전 | 2589 | |
| 1841 |
갈색야생마
|
17년 전 | 2769 | |
| 1840 |
갈색야생마
|
17년 전 | 2718 | |
| 1839 |
갈색야생마
|
17년 전 | 3222 | |
| 1838 |
갈색야생마
|
17년 전 | 2350 | |
| 1837 |
갈색야생마
|
17년 전 | 2467 | |
| 1836 |
갈색야생마
|
17년 전 | 2530 | |
| 1835 |
갈색야생마
|
17년 전 | 2518 | |
| 1834 |
갈색야생마
|
17년 전 | 2656 | |
| 1833 |
갈색야생마
|
17년 전 | 3180 | |
| 1832 |
갈색야생마
|
17년 전 | 2691 | |
| 1831 |
갈색야생마
|
17년 전 | 1424 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기