<?
include_once("./connect_db.php");
$code = $_POST["code"];
if($member[mb_id]){
$query=mysql_query("update '$dataname' set occupant='$member[mb_id]',regdate='$date' where code='$code' limit 1",$connect);
}else{
alert('로그인 해주세요');
}
$code = $_POST["code"];
if($member[mb_id]){
$query=mysql_query("update '$dataname' set occupant='$member[mb_id]',regdate='$date' where code='$code' limit 1",$connect);
}else{
alert('로그인 해주세요');
}
?>
포스트로 받아온 $code 가 db안에 있는 code 와 일치하는것이 없다면 없는 코드라고 띄우고싶은데 어떻게 해야할까요?
댓글 3개
13년 전
먼저 select 해보시면 될듯 합니다.
<?
if($memeber[mb_id]) {
$query = mysql_query("select count(*) from $dataname where code=$code");
$result = mysql_fetch_row($result);
if($result[0] >0 ) {
$query=mysql_query("update '$dataname' set occupant='$member[mb_id]',regdate='$date' where code='$code' limit 1",$connect);
} else {
echo "코드가 없습니다. 다시 시도하여 주십시오."
}
}else{
alert('로그인 해주세요');
}
?>
<?
if($memeber[mb_id]) {
$query = mysql_query("select count(*) from $dataname where code=$code");
$result = mysql_fetch_row($result);
if($result[0] >0 ) {
$query=mysql_query("update '$dataname' set occupant='$member[mb_id]',regdate='$date' where code='$code' limit 1",$connect);
} else {
echo "코드가 없습니다. 다시 시도하여 주십시오."
}
}else{
alert('로그인 해주세요');
}
?>
hy미디어
13년 전
밴닛님이 설명 해주셨네요 ㅎㅎ db안에 있는 code를 먼저 뽑아야 겠죵 ㅎㅎ
천재조상훈
13년 전
감사
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 230 | 20년 전 | 2090 | ||
| 229 | 20년 전 | 3149 | ||
| 228 | 20년 전 | 3342 | ||
| 227 | 20년 전 | 2417 | ||
| 226 | 20년 전 | 5497 | ||
| 225 | 20년 전 | 2538 | ||
| 224 | 20년 전 | 2981 | ||
| 223 | 20년 전 | 4215 | ||
| 222 | 20년 전 | 2613 | ||
| 221 | 20년 전 | 2302 | ||
| 220 | 20년 전 | 3690 | ||
| 219 | 20년 전 | 2085 | ||
| 218 | 20년 전 | 3588 | ||
| 217 | 20년 전 | 2497 | ||
| 216 | 20년 전 | 2936 | ||
| 215 | 20년 전 | 2245 | ||
| 214 | 20년 전 | 3353 | ||
| 213 | 20년 전 | 2934 | ||
| 212 | 20년 전 | 3074 | ||
| 211 | 20년 전 | 2160 | ||
| 210 | 20년 전 | 1931 | ||
| 209 | 20년 전 | 2383 | ||
| 208 | 20년 전 | 2009 | ||
| 207 | 20년 전 | 1692 | ||
| 206 | 20년 전 | 1867 | ||
| 205 | 20년 전 | 3962 | ||
| 204 | 20년 전 | 1684 | ||
| 203 | 20년 전 | 2025 | ||
| 202 | 20년 전 | 2369 | ||
| 201 | 20년 전 | 1840 | ||
| 200 | 20년 전 | 2972 | ||
| 199 | 20년 전 | 2014 | ||
| 198 | 20년 전 | 2098 | ||
| 197 | 20년 전 | 3671 | ||
| 196 | 20년 전 | 3010 | ||
| 195 | 20년 전 | 2120 | ||
| 194 | 20년 전 | 10273 | ||
| 193 | 20년 전 | 2264 | ||
| 192 | 20년 전 | 1617 | ||
| 191 | 20년 전 | 2681 | ||
| 190 | 20년 전 | 2301 | ||
| 189 | 20년 전 | 1702 | ||
| 188 | 20년 전 | 1504 | ||
| 187 | 20년 전 | 1925 | ||
| 186 | 20년 전 | 1752 | ||
| 185 | 20년 전 | 1797 | ||
| 184 | 20년 전 | 2380 | ||
| 183 | 20년 전 | 1592 | ||
| 182 | 20년 전 | 1500 | ||
| 181 | 20년 전 | 1640 | ||
| 180 | 20년 전 | 2739 | ||
| 179 | 20년 전 | 1825 | ||
| 178 | 20년 전 | 1877 | ||
| 177 | 20년 전 | 2003 | ||
| 176 | 20년 전 | 1812 | ||
| 175 | 20년 전 | 1881 | ||
| 174 | 20년 전 | 1713 | ||
| 173 | 20년 전 | 2071 | ||
| 172 | 20년 전 | 1795 | ||
| 171 | 20년 전 | 2580 | ||
| 170 | 20년 전 | 2298 | ||
| 169 | 20년 전 | 2574 | ||
| 168 | 20년 전 | 1513 | ||
| 167 | 20년 전 | 1600 | ||
| 166 | 20년 전 | 2174 | ||
| 165 | 20년 전 | 1661 | ||
| 164 | 20년 전 | 3792 | ||
| 163 | 20년 전 | 2689 | ||
| 162 | 20년 전 | 2110 | ||
| 161 | 20년 전 | 2819 | ||
| 160 | 20년 전 | 1756 | ||
| 159 | 20년 전 | 1635 | ||
| 158 | 20년 전 | 2587 | ||
| 157 | 20년 전 | 1515 | ||
| 156 | 20년 전 | 1774 | ||
| 155 | 20년 전 | 3249 | ||
| 154 | 20년 전 | 1922 | ||
| 153 | 20년 전 | 1637 | ||
| 152 | 20년 전 | 4976 | ||
| 151 | 20년 전 | 4597 | ||
| 150 | 20년 전 | 3539 | ||
| 149 | 20년 전 | 3816 | ||
| 148 | 20년 전 | 7100 | ||
| 147 | 20년 전 | 3569 | ||
| 146 | 20년 전 | 2648 | ||
| 145 | 20년 전 | 2640 | ||
| 144 | 20년 전 | 7178 | ||
| 143 | 20년 전 | 4623 | ||
| 142 | 20년 전 | 1911 | ||
| 141 | 20년 전 | 3266 | ||
| 140 | 20년 전 | 1987 | ||
| 139 | 20년 전 | 1614 | ||
| 138 | 20년 전 | 2332 | ||
| 137 | 20년 전 | 1805 | ||
| 136 | 20년 전 | 1473 | ||
| 135 | 20년 전 | 1813 | ||
| 134 | 20년 전 | 2989 | ||
| 133 | 20년 전 | 2473 | ||
| 132 | 20년 전 | 1717 | ||
| 131 | 20년 전 | 1666 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기