내가 데이터베이스에 저장된 모든 이미지를 표시 할 데이터베이스에 저장된 표시 할 수 없습니다 .. 다음 내 문제는 작은 사각형이 .. 저 좀 도와주세요 ..내 이미지
내 maincontent.php 나타날 것입니다
<?php
error_reporting(E_ALL);
$link = mysql_connect("localhost", "root", "") or die("Could not connect: " . mysql_error());
mysql_select_db("login") or die(mysql_error());
$sql = "SELECT id FROM products";
$result = mysql_query("$sql") or die("Invalid query: " . mysql_error());
while($row=mysql_fetch_assoc($result)){
echo '<img src="t2.php?id='.$row['id'].'"/>';
}
mysql_close($link);
?>
내 t2.php는
<?php
error_reporting(E_ALL);
if(isset($_GET['id']) && is_numeric($_GET['id'])) {
$link = mysql_connect("localhost", "root", "") or die("Could not&nbsp;connect: " . mysql_error());
mysql_select_db("login") or die(mysql_error());
$sql = "SELECT photo FROM products WHERE id={$_GET['id']}";
$result = mysql_query("$sql") or die("Invalid query: " . mysql_error());
header("Content-type: image/jpeg");
echo mysql_result($result, 0);
mysql_close($link);
}else{
echo 'Please use&;nbsp;a real id number';
}
?>
나는 누군가가이 문제에 관한 나를 도울 수 있기를 바랍니다.
메신저 데이터베이스에서 이미지를 저장하는 데 BLOB를 사용합니다. 결과는 다음과 같습니다 : https://dl.dropboxusercontent.com/u/87636874/Capture.JPG – user2699948
브라우저에서't2.php? id = SOMEID'를 수동으로 열면 무엇을 얻게됩니까? 에러를 위해서'echo'를 사용하고 있기 때문에'' 태그 안에 그것들을 볼 수 없기 때문에 이것을 검사해야합니다. –
오류가 발견되지 않습니다. BLOB가 올바르게 저장 되었습니까? 몇 줄에 mysqldunp를 제공 할 수 있습니까? – blue