<?
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년 전
감사
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5030 | 13년 전 | 784 | ||
| 5029 | 13년 전 | 465 | ||
| 5028 | 13년 전 | 729 | ||
| 5027 | 13년 전 | 1318 | ||
| 5026 | 13년 전 | 548 | ||
| 5025 | 13년 전 | 1370 | ||
| 5024 | 13년 전 | 423 | ||
| 5023 | 13년 전 | 662 | ||
| 5022 | 13년 전 | 429 | ||
| 5021 | 13년 전 | 667 | ||
| 5020 | 13년 전 | 516 | ||
| 5019 | 13년 전 | 858 | ||
| 5018 | 13년 전 | 906 | ||
| 5017 | 13년 전 | 783 | ||
| 5016 | 13년 전 | 2628 | ||
| 5015 | 13년 전 | 415 | ||
| 5014 | 13년 전 | 674 | ||
| 5013 | 13년 전 | 588 | ||
| 5012 |
JacobJeon
|
13년 전 | 1075 | |
| 5011 | 13년 전 | 806 | ||
| 5010 | 13년 전 | 1443 | ||
| 5009 |
JacobJeon
|
13년 전 | 1802 | |
| 5008 | 13년 전 | 1152 | ||
| 5007 | 13년 전 | 3016 | ||
| 5006 |
|
13년 전 | 1307 | |
| 5005 | 13년 전 | 698 | ||
| 5004 | 13년 전 | 2106 | ||
| 5003 | 13년 전 | 2531 | ||
| 5002 | 13년 전 | 387 | ||
| 5001 | 13년 전 | 520 | ||
| 5000 | 13년 전 | 427 | ||
| 4999 | 13년 전 | 526 | ||
| 4998 | 13년 전 | 473 | ||
| 4997 | 13년 전 | 661 | ||
| 4996 | 13년 전 | 1919 | ||
| 4995 | 13년 전 | 393 | ||
| 4994 | 13년 전 | 383 | ||
| 4993 | 13년 전 | 529 | ||
| 4992 | 13년 전 | 503 | ||
| 4991 | 13년 전 | 388 | ||
| 4990 | 13년 전 | 710 | ||
| 4989 | 13년 전 | 653 | ||
| 4988 | 13년 전 | 400 | ||
| 4987 | 13년 전 | 422 | ||
| 4986 | 13년 전 | 1380 | ||
| 4985 | 13년 전 | 665 | ||
| 4984 | 13년 전 | 1046 | ||
| 4983 | 13년 전 | 413 | ||
| 4982 |
쥬드125
|
13년 전 | 1019 | |
| 4981 | 13년 전 | 548 | ||
| 4980 | 13년 전 | 419 | ||
| 4979 | 13년 전 | 694 | ||
| 4978 | 13년 전 | 2184 | ||
| 4977 |
atria
|
13년 전 | 865 | |
| 4976 | 13년 전 | 1531 | ||
| 4975 | 13년 전 | 439 | ||
| 4974 | 13년 전 | 467 | ||
| 4973 | 13년 전 | 705 | ||
| 4972 | 13년 전 | 462 | ||
| 4971 | 13년 전 | 1393 | ||
| 4970 | 13년 전 | 370 | ||
| 4969 | 13년 전 | 423 | ||
| 4968 | 13년 전 | 732 | ||
| 4967 | 13년 전 | 533 | ||
| 4966 | 13년 전 | 445 | ||
| 4965 | 13년 전 | 587 | ||
| 4964 | 13년 전 | 591 | ||
| 4963 | 13년 전 | 428 | ||
| 4962 | 13년 전 | 2252 | ||
| 4961 | 13년 전 | 1350 | ||
| 4960 | 13년 전 | 1233 | ||
| 4959 | 13년 전 | 429 | ||
| 4958 | 13년 전 | 383 | ||
| 4957 | 13년 전 | 472 | ||
| 4956 | 13년 전 | 702 | ||
| 4955 | 13년 전 | 494 | ||
| 4954 | 13년 전 | 1066 | ||
| 4953 | 13년 전 | 1160 | ||
| 4952 | 13년 전 | 754 | ||
| 4951 |
sjsmsrjfflauswnrsmse
|
13년 전 | 879 | |
| 4950 | 13년 전 | 1911 | ||
| 4949 | 13년 전 | 2223 | ||
| 4948 | 13년 전 | 5528 | ||
| 4947 | 13년 전 | 415 | ||
| 4946 | 13년 전 | 852 | ||
| 4945 | 13년 전 | 406 | ||
| 4944 | 13년 전 | 608 | ||
| 4943 |
마당쇠2000
|
13년 전 | 1257 | |
| 4942 |
cula100jak
|
13년 전 | 828 | |
| 4941 | 13년 전 | 474 | ||
| 4940 | 13년 전 | 574 | ||
| 4939 | 13년 전 | 418 | ||
| 4938 | 13년 전 | 567 | ||
| 4937 | 13년 전 | 1503 | ||
| 4936 |
techer
|
13년 전 | 1854 | |
| 4935 | 13년 전 | 725 | ||
| 4934 | 13년 전 | 961 | ||
| 4933 | 13년 전 | 2048 | ||
| 4932 |
kajama78
|
13년 전 | 964 | |
| 4931 | 13년 전 | 987 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기