db blobp 에 저장된 그림 출력하기
글쓴이: ant01 / 작성시간: 화, 2012/08/28 - 1:50오전
그림 출력하는 소스를 작성해 보았습니다. 저장 할 때 addslashes함수를 이용하였기에
stripslashes()함수를 이용한 다음 출력해 보았더니 잘 될줄 알았는 데 깨진 데이터만 나오는 군요. 무엇이 문제일까요?
<?php $connect=mysql_connect("localhost","php","test06") or die(mysql_error()); mysql_select_db("shop0") or die("데이타베이스를 선택할 수 없습니다."); mysql_query("set names utf8"); $query="select * from test where no='3'"; $result=mysql_query($query,$connect); $data=mysql_fetch_array($result); $image=stripslashes($data[picture]); echo $image; mysql_close($connect); ?>
Forums:
addslashes;;
addslashes;; mysql_escape_string() 을 안쓰셨네요;
아래의 글을 읽어주세요.
http://www.phpschool.com/link/tipntech/68047
http://www.phpschool.com/link/tipntech/54406
함수가 무슨 기능을 하는지는 http://kr.php.net/manual/en/ 여기서 보시면 됩니다.
ps. escape 를 하는 이유는 insert 쿼리문과 데이터를 구분하기 위함이고,
select 결과는 escape 되지 않은 문자열 입니다.
https://xenosi.de/
감사힙니다.
송효진님이 잘 가르켜 주셨는데도 헤멨습니다.
동작확인하고 알아낸 것 정리하여 올렸습니다.
http://antonio.pyy.kr/index.php?mid=computer&document_srl=3984
그런데 표시 할 때 사이즈, 위치 지정은 어떻게 하나요.
크기와 [위치] 는 html 담당이죠. img
크기와 [위치] 는 html 담당이죠.
img src="/storedimage.php?seq=1" width="100" style="margin:5px 3px;"
그림이 작다면 이런것도 됩니다.
http://webcodertools.com/imagetobase64converter
https://xenosi.de/
댓글 달기