<?php
$imageId = (int) $_GET['image_id'];
$query = mysql_query('SELECT `image` FROM `news` WHERE `id` = '.$imageId);
if (mysql_num_rows($query))
{
header('Content-type: image/png');
exit(mysql_fetch_assoc($query)['image']);
}
else
{
// Нет такой картинки
}
$result = mysql_query("SELECT * FROM news ",$link);
while($row = mysql_fetch_array($result)){
echo '
<h2>'.$row["title"].'</h2>
<img src="getImage.php?image_id=',$row['id'],'"/>
<p>'.$row["text"].'</p>
';
var_dump($row['image']); //посмотрите что внутри
}
header('X-Accel-Redirect: /var/www/sitename.com/www/app/data/myMediaFile.mp4');
header('Content-Type: video/mp4');
header('Content-Disposition: attachment; filename=MediaFile.mp4');