I have a query that gets and outputs pictures from an SQL database.
Here is the code
Code: Select all
<?PHP
$fname = $_POST["fname"];
$lname = $_POST["lname"];
$connectionstring = odbc_connect("photos","","");
$query = "SELECT firstname, lastname, image FROM ImageDB WHERE(firstname=$fname AND lastname=$lname)";
$queryexec = odbc_exec($connectiontsring, $query);
$result = odbc_fetch_array($queryexec);
echo $result['firstname'] . "<BR>" . $result['lastname'] . "<BR>";
$filename = "photo.jpg";
$fp = fopen ($filename, "w");
echo "<img src="$filename"><BR>";
fclose($fp);
unlink ($filename);
?>My problem is this: Since the size of all variables in PHP is 4kb, I can only see that much of the photo. The rest just does not show up.
Is there any way that I can get around this problem?
Thanks.