Dear friends. Long long time ago I started my voyage trying to learn web pages cpding, but I had problems that are not concerng anyone, but me (c' est la vie) Returning frompast versins (1.6 - 1.9) I encounterd a nw environmen from the one i left in pthe past. Trying to rsolve problms regarding past code I' ve been told that things were changed and that I have to start from scratch, snce no compatibility backwards has been provided. My aim is to find a way to open a blob field stored fieldin a mysql table in a new page. There were three parts in the old code.
Calling Page:
................
<?php
$db = mysql_connect("localhost", "root", "r00t");
mysql_select_db("alpha", $db) or die(mysql_errno() . ": " . mysql_error() . "<br>");
................
echo "<td align=\"center\">";
// echo "<a href = \"content.php?id=$id\"</a>";
.................
?>
Dispplay Page:
<?php
$my_id = $_GET['my_id'];
if ($id_files)
if ($my_id)
{
include "open_db.inc";
$result = @mysql_query($sql, $db);
$data = @mysql_result($result, 0, "bin_data");
$name = @mysql_result($result, 0, "filename");
$size = @mysql_result($result, 0, "filesize");
$type = @mysql_result($result, 0, "filetype");
header("Content-type: $type");
header("Content-length: $size");
header("Content-Disposition: attachment; filename=$name");
header("Content-Description: PHP Generated Data");
echo $data;
}
?>
And the Module "open_db.inc
$db = mysql_connect("localhost", "binary_user", "binary_password");
mysql_select_db("binary_files", $db) or die(mysql_errno() . ": " . mysql_error() . "<br>");
Of course if things have been dramaticaly chaged then the blob files stored in the table would be erroneous, but I must first to find a way to oen/savee frst. But this is an other story to tell after solving this problem.
Pls help a time traveller from the past!
I followed Larry Ullman's third edition of PHP mySQL Web Programming in the past..