아래 소스보면 hidden 값으로 no 값은 $no으로 넘어가고..
old_img 값은 hidden값으로 <?=$data[img]?> 값으로 넘어가는데..
위 두가지 차이가 뭐죠??
위에 $no을 hidden값으로 넘기는게 위에 쿼리문에서 no = '$no'라는 sql문때문에 $no가 되는건가요??
old_img 값은 hidden값으로 <?=$data[img]?> 값으로 넘어가는데..
위 두가지 차이가 뭐죠??
위에 $no을 hidden값으로 넘기는게 위에 쿼리문에서 no = '$no'라는 sql문때문에 $no가 되는건가요??
$no 대신에 <?=$data[no]?>으로 바꾸면 값이 안넘어가지더라구요..
<?
include "lib.php";
$connect = dbconn();
include "lib.php";
$connect = dbconn();
$query = " select * from shop_data where no='$no'";
$result = mysql_query($query, $connect);
$data = mysql_fetch_array($result);
?>
<form action=shop_edit_post.php method=post enctype=multipart/form-data>
<input type=hidden name=no value='<?=$no?>'>
<input type=hidden name=old_name value='<?=$data[img]?>'>
<table width=500 border=1>
<tr>
<td> 상품명</td>
<td><input type=text name=name size=30 value='<?=$data[name]?>'></td>
</tr>
<tr>
<td>짧은설명</td>
<td><input type=text name=comment size=50 value='<?=$data[comment]?>'></td>
</tr>
<tr>
<td>금액</td>
<td><input type=text name=price size=10 value='<?=$data[price]?>'></td>
</tr>
<tr>
<td>설명</td>
<td><textarea rows=10 cols=50 name=memo><?=$data[memo]?></textarea></td>
</tr>
<tr>
<td>이미지</td>
<td><img src="../shop/data/<?=$data[img]?>" height=40><input type=file name=img size=30 value='<?=$data[img]?>'></td>
</tr>
<tr>
<td colspan=2><input type=submit value='수정하기'></td>
</tr>
</table>
</form>
$result = mysql_query($query, $connect);
$data = mysql_fetch_array($result);
?>
<form action=shop_edit_post.php method=post enctype=multipart/form-data>
<input type=hidden name=no value='<?=$no?>'>
<input type=hidden name=old_name value='<?=$data[img]?>'>
<table width=500 border=1>
<tr>
<td> 상품명</td>
<td><input type=text name=name size=30 value='<?=$data[name]?>'></td>
</tr>
<tr>
<td>짧은설명</td>
<td><input type=text name=comment size=50 value='<?=$data[comment]?>'></td>
</tr>
<tr>
<td>금액</td>
<td><input type=text name=price size=10 value='<?=$data[price]?>'></td>
</tr>
<tr>
<td>설명</td>
<td><textarea rows=10 cols=50 name=memo><?=$data[memo]?></textarea></td>
</tr>
<tr>
<td>이미지</td>
<td><img src="../shop/data/<?=$data[img]?>" height=40><input type=file name=img size=30 value='<?=$data[img]?>'></td>
</tr>
<tr>
<td colspan=2><input type=submit value='수정하기'></td>
</tr>
</table>
</form>
댓글 3개
13년 전
$no 는 이파일을 연결할때 가져온 값이겠구요.
$data[no]는 mysql에서 $data = mysql_fetch_array($result);이렇게 연결된 배열로 해당하는 필드값 이겠구요. no가 키값이면 어차피 값은 같아야 겠지요.
$data[no]는 mysql에서 $data = mysql_fetch_array($result);이렇게 연결된 배열로 해당하는 필드값 이겠구요. no가 키값이면 어차피 값은 같아야 겠지요.
배우는이군
13년 전
같은 파일인데 <? print_R($data); ?>
안에 들어있는 필드 값을 확인해보시면 될꺼 같은데요
$data[no] 이나 $no이나 같은값입니다.
안에 들어있는 필드 값을 확인해보시면 될꺼 같은데요
$data[no] 이나 $no이나 같은값입니다.
13년 전
$data[no] => 데이터베이스에 들어간 값 ( 어떠한 값이 아닌 이미 정해진 값을 불러들임 )
$no => 새로운 데이터값 ( 어떤한 값이든 들어갈 수 있는 변수 )
위의 차이로 봐야할거 같은데요 ^^;
$no => 새로운 데이터값 ( 어떤한 값이든 들어갈 수 있는 변수 )
위의 차이로 봐야할거 같은데요 ^^;
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7830 | 10년 전 | 449 | ||
| 7829 |
|
10년 전 | 635 | |
| 7828 | 10년 전 | 561 | ||
| 7827 | 10년 전 | 457 | ||
| 7826 | 10년 전 | 469 | ||
| 7825 | 10년 전 | 512 | ||
| 7824 | 10년 전 | 470 | ||
| 7823 | 10년 전 | 414 | ||
| 7822 | 10년 전 | 390 | ||
| 7821 | 10년 전 | 332 | ||
| 7820 | 10년 전 | 361 | ||
| 7819 |
|
10년 전 | 765 | |
| 7818 | 10년 전 | 411 | ||
| 7817 | 10년 전 | 573 | ||
| 7816 | 10년 전 | 431 | ||
| 7815 | 10년 전 | 626 | ||
| 7814 | 10년 전 | 467 | ||
| 7813 | 10년 전 | 420 | ||
| 7812 | 10년 전 | 429 | ||
| 7811 | 10년 전 | 411 | ||
| 7810 | 10년 전 | 607 | ||
| 7809 | 10년 전 | 540 | ||
| 7808 | 10년 전 | 417 | ||
| 7807 | 10년 전 | 433 | ||
| 7806 |
프로그래머7
|
10년 전 | 1357 | |
| 7805 | 10년 전 | 1298 | ||
| 7804 |
zahir1312
|
10년 전 | 795 | |
| 7803 |
|
10년 전 | 1396 | |
| 7802 | 10년 전 | 491 | ||
| 7801 | 10년 전 | 880 | ||
| 7800 | 10년 전 | 1101 | ||
| 7799 | 10년 전 | 583 | ||
| 7798 | 10년 전 | 535 | ||
| 7797 | 10년 전 | 550 | ||
| 7796 | 10년 전 | 385 | ||
| 7795 | 10년 전 | 538 | ||
| 7794 | 10년 전 | 583 | ||
| 7793 | 10년 전 | 1079 | ||
| 7792 | 10년 전 | 504 | ||
| 7791 | 10년 전 | 584 | ||
| 7790 | 10년 전 | 523 | ||
| 7789 |
fbastore
|
10년 전 | 1475 | |
| 7788 | 10년 전 | 575 | ||
| 7787 | 10년 전 | 433 | ||
| 7786 | 10년 전 | 636 | ||
| 7785 | 10년 전 | 617 | ||
| 7784 | 10년 전 | 673 | ||
| 7783 | 10년 전 | 487 | ||
| 7782 | 10년 전 | 520 | ||
| 7781 | 10년 전 | 925 | ||
| 7780 | 10년 전 | 839 | ||
| 7779 | 10년 전 | 793 | ||
| 7778 | 10년 전 | 378 | ||
| 7777 | 10년 전 | 489 | ||
| 7776 | 10년 전 | 486 | ||
| 7775 | 10년 전 | 427 | ||
| 7774 | 10년 전 | 640 | ||
| 7773 | 10년 전 | 397 | ||
| 7772 | 10년 전 | 765 | ||
| 7771 | 10년 전 | 417 | ||
| 7770 | 10년 전 | 664 | ||
| 7769 | 10년 전 | 419 | ||
| 7768 | 10년 전 | 641 | ||
| 7767 | 10년 전 | 1201 | ||
| 7766 | 10년 전 | 525 | ||
| 7765 | 10년 전 | 578 | ||
| 7764 |
잘살아보자
|
10년 전 | 426 | |
| 7763 |
|
10년 전 | 1489 | |
| 7762 |
Tosea
|
10년 전 | 1083 | |
| 7761 | 10년 전 | 678 | ||
| 7760 |
잘살아보자
|
10년 전 | 725 | |
| 7759 |
잘살아보자
|
10년 전 | 565 | |
| 7758 |
잘살아보자
|
10년 전 | 624 | |
| 7757 | 10년 전 | 1267 | ||
| 7756 |
ITBANK
|
10년 전 | 1278 | |
| 7755 | 10년 전 | 1940 | ||
| 7754 | 10년 전 | 1090 | ||
| 7753 | 10년 전 | 908 | ||
| 7752 | 10년 전 | 1413 | ||
| 7751 |
잘살아보자
|
10년 전 | 565 | |
| 7750 |
잘살아보자
|
10년 전 | 495 | |
| 7749 |
잘살아보자
|
10년 전 | 517 | |
| 7748 |
잘살아보자
|
10년 전 | 538 | |
| 7747 |
잘살아보자
|
10년 전 | 617 | |
| 7746 |
잘살아보자
|
10년 전 | 694 | |
| 7745 |
잘살아보자
|
10년 전 | 937 | |
| 7744 |
잘살아보자
|
10년 전 | 433 | |
| 7743 | 10년 전 | 963 | ||
| 7742 |
starbros
|
10년 전 | 856 | |
| 7741 |
잘살아보자
|
10년 전 | 699 | |
| 7740 |
잘살아보자
|
10년 전 | 581 | |
| 7739 |
잘살아보자
|
10년 전 | 480 | |
| 7738 |
잘살아보자
|
10년 전 | 558 | |
| 7737 |
잘살아보자
|
10년 전 | 534 | |
| 7736 |
잘살아보자
|
10년 전 | 552 | |
| 7735 |
잘살아보자
|
10년 전 | 886 | |
| 7734 |
잘살아보자
|
10년 전 | 445 | |
| 7733 |
잘살아보자
|
10년 전 | 561 | |
| 7732 |
잘살아보자
|
10년 전 | 722 | |
| 7731 |
잘살아보자
|
10년 전 | 642 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기