아래 소스보면 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 => 새로운 데이터값 ( 어떤한 값이든 들어갈 수 있는 변수 )
위의 차이로 봐야할거 같은데요 ^^;
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7130 | 11년 전 | 2304 | ||
| 7129 | 11년 전 | 711 | ||
| 7128 |
senseme
|
11년 전 | 1302 | |
| 7127 | 11년 전 | 1175 | ||
| 7126 | 11년 전 | 824 | ||
| 7125 | 11년 전 | 2953 | ||
| 7124 | 11년 전 | 1428 | ||
| 7123 |
잘살아보자
|
11년 전 | 1291 | |
| 7122 |
잘살아보자
|
11년 전 | 689 | |
| 7121 |
잘살아보자
|
11년 전 | 3052 | |
| 7120 |
잘살아보자
|
11년 전 | 2919 | |
| 7119 |
잘살아보자
|
11년 전 | 732 | |
| 7118 |
잘살아보자
|
11년 전 | 3433 | |
| 7117 |
잘살아보자
|
11년 전 | 854 | |
| 7116 | 11년 전 | 746 | ||
| 7115 | 11년 전 | 1035 | ||
| 7114 | 11년 전 | 853 | ||
| 7113 | 11년 전 | 668 | ||
| 7112 | 11년 전 | 1087 | ||
| 7111 | 11년 전 | 1800 | ||
| 7110 | 11년 전 | 1035 | ||
| 7109 |
버섯먹은나
|
11년 전 | 814 | |
| 7108 | 11년 전 | 648 | ||
| 7107 | 11년 전 | 2414 | ||
| 7106 | 11년 전 | 1963 | ||
| 7105 | 11년 전 | 2485 | ||
| 7104 | 11년 전 | 1425 | ||
| 7103 |
|
11년 전 | 2712 | |
| 7102 | 11년 전 | 3122 | ||
| 7101 | 11년 전 | 4447 | ||
| 7100 | 11년 전 | 5794 | ||
| 7099 | 11년 전 | 2143 | ||
| 7098 | 11년 전 | 1726 | ||
| 7097 | 11년 전 | 1465 | ||
| 7096 | 11년 전 | 1132 | ||
| 7095 |
잘살아보자
|
11년 전 | 859 | |
| 7094 |
잘살아보자
|
11년 전 | 1063 | |
| 7093 |
잘살아보자
|
11년 전 | 940 | |
| 7092 |
잘살아보자
|
11년 전 | 1413 | |
| 7091 |
잘살아보자
|
11년 전 | 2212 | |
| 7090 |
잘살아보자
|
11년 전 | 897 | |
| 7089 | 11년 전 | 1071 | ||
| 7088 | 11년 전 | 1715 | ||
| 7087 | 11년 전 | 1412 | ||
| 7086 | 11년 전 | 1315 | ||
| 7085 |
|
11년 전 | 1239 | |
| 7084 | 11년 전 | 1157 | ||
| 7083 | 11년 전 | 3507 | ||
| 7082 | 11년 전 | 1156 | ||
| 7081 | 11년 전 | 1741 | ||
| 7080 | 11년 전 | 2026 | ||
| 7079 | 11년 전 | 1334 | ||
| 7078 | 11년 전 | 1305 | ||
| 7077 | 11년 전 | 1314 | ||
| 7076 | 11년 전 | 772 | ||
| 7075 | 11년 전 | 1155 | ||
| 7074 |
네이비칼라
|
11년 전 | 1510 | |
| 7073 | 11년 전 | 1480 | ||
| 7072 |
|
11년 전 | 836 | |
| 7071 | 11년 전 | 1211 | ||
| 7070 | 11년 전 | 936 | ||
| 7069 | 11년 전 | 1710 | ||
| 7068 | 11년 전 | 1367 | ||
| 7067 |
TPSint
|
11년 전 | 750 | |
| 7066 | 11년 전 | 2155 | ||
| 7065 | 11년 전 | 6653 | ||
| 7064 | 11년 전 | 1298 | ||
| 7063 | 11년 전 | 1142 | ||
| 7062 | 11년 전 | 1081 | ||
| 7061 | 11년 전 | 920 | ||
| 7060 | 11년 전 | 1477 | ||
| 7059 | 11년 전 | 887 | ||
| 7058 |
EngineMan
|
11년 전 | 3408 | |
| 7057 | 11년 전 | 1251 | ||
| 7056 | 11년 전 | 1642 | ||
| 7055 | 11년 전 | 1022 | ||
| 7054 | 11년 전 | 2660 | ||
| 7053 |
네이비칼라
|
11년 전 | 1291 | |
| 7052 | 11년 전 | 2584 | ||
| 7051 | 11년 전 | 1944 | ||
| 7050 | 11년 전 | 2457 | ||
| 7049 | 11년 전 | 1415 | ||
| 7048 | 11년 전 | 2540 | ||
| 7047 | 11년 전 | 1363 | ||
| 7046 | 11년 전 | 1042 | ||
| 7045 | 11년 전 | 1069 | ||
| 7044 | 11년 전 | 5441 | ||
| 7043 | 11년 전 | 1234 | ||
| 7042 | 11년 전 | 794 | ||
| 7041 |
열라뽕똬이
|
11년 전 | 763 | |
| 7040 | 11년 전 | 1118 | ||
| 7039 | 11년 전 | 1470 | ||
| 7038 | 11년 전 | 1882 | ||
| 7037 | 11년 전 | 2182 | ||
| 7036 | 11년 전 | 1089 | ||
| 7035 | 11년 전 | 1412 | ||
| 7034 | 11년 전 | 1364 | ||
| 7033 |
열라뽕똬이
|
11년 전 | 1001 | |
| 7032 | 11년 전 | 756 | ||
| 7031 | 11년 전 | 2188 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기