image manipulation php mysql blob type
Posted: Mon May 30, 2011 3:30 pm
hello there! i got a question about blob mysql data.i have a button and on buttonclick i want to open a popup (and passing date parameter) and show some details and display a photo.if i try
[syntax=php]<?php
if (isset($_GET['p'])){
$temp_date=$_GET['p'];
echo "DATE : $temp_d <br>";
$connect=mysql_connect("localhost","user","pass")
or die ("Check your server connection");
$db_found = mysql_select_db("mydb", $connect);
$SQL = "SELECT * FROM mytable
WHERE date =$temp_d";
$result = mysql_query($SQL);
$row=mysql_fetch_array($result);
echo "Details: $row[details]<br>";
$content = $row['image'];
header('Content-type:image/jpg');
echo $content;
} ?>
[/syntax]
its not working.in firefox its shows the name of the script+parameter and in IE opens a download box
If i try
[syntax=php]<?php
$connect=mysql_connect("localhost","user","pass")
or die ("Check your server connection");
$db_found = mysql_select_db("mydb", $connect);
$SQL = "SELECT * FROM mytable
WHERE id=1";
$result = mysql_query($SQL);
$row=mysql_fetch_array($result);
$content = $row['image'];
header('Content-type:image/jpg');
} ?>[/syntax]
its shows my stored image.how to pass the parameter and show the results to ? i dont know how thats possible but if i dont put
echo $content; i got my data (from other echoes) .how to have both image echo and details echo ?? tnx in advance
[syntax=php]<?php
if (isset($_GET['p'])){
$temp_date=$_GET['p'];
echo "DATE : $temp_d <br>";
$connect=mysql_connect("localhost","user","pass")
or die ("Check your server connection");
$db_found = mysql_select_db("mydb", $connect);
$SQL = "SELECT * FROM mytable
WHERE date =$temp_d";
$result = mysql_query($SQL);
$row=mysql_fetch_array($result);
echo "Details: $row[details]<br>";
$content = $row['image'];
header('Content-type:image/jpg');
echo $content;
} ?>
[/syntax]
its not working.in firefox its shows the name of the script+parameter and in IE opens a download box
If i try
[syntax=php]<?php
$connect=mysql_connect("localhost","user","pass")
or die ("Check your server connection");
$db_found = mysql_select_db("mydb", $connect);
$SQL = "SELECT * FROM mytable
WHERE id=1";
$result = mysql_query($SQL);
$row=mysql_fetch_array($result);
$content = $row['image'];
header('Content-type:image/jpg');
} ?>[/syntax]
its shows my stored image.how to pass the parameter and show the results to ? i dont know how thats possible but if i dont put
echo $content; i got my data (from other echoes) .how to have both image echo and details echo ?? tnx in advance