Jump to content

Regarding image retrieve problem


nikhil_nkjain

Recommended Posts

this is image.php file

 

<?php

include ("../../conf/config.php");

global $db_slave;

global $Log_File;

global $Log_Mail;

 

if($_REQUEST['page'] == 'product'){

$sql[] = "SELECT  web_productonline_log.cardimage, ";

$sql[] = "web_productonline_log.extension ";

$sql[] = "FROM  ".DB_CMS.".web_productonline web_productonline,".DB_CMS.".web_productonline_log web_productonline_log ";

$sql[] = " WHERE  ( web_productonline.idproduct_log = web_productonline_log.idproduct_log ) ";

$sql[] = "  AND  ( web_productonline.idproduct = '" . $_REQUEST['id'] . "' ) ";

$sql[] = "  AND  ( web_productonline.deleted = 0 ) ";

 

 

$sqlSelect = join('',$sql);

unset($sql);

$Log_File->log($sqlSelect);

$row = $db_slave->queryRow($sqlSelect);

 

$image = $row["cardimage"];

$ext = $row["extension"];

header("Content-type: $ext");

echo base64_decode($image);

}

 

else if($_REQUEST['page'] == 'banner'){

$sql[] = "SELECT  web_banner.bannerimage, ";

$sql[] = "web_banner.extension ";

$sql[] = " FROM  ".DB_CMS.".web_banner web_banner ";

$sql[] = "  WHERE  ( web_banner.idbanner = '" . $_REQUEST['id'] . "' ) ";

$sql[] = "  AND  ( web_banner.deleted = 0 ) ";

 

$sqlSelect = join('',$sql);

unset($sql);

$Log_File->log("11111111111111".$sqlSelect);

$row = $db_slave->queryRow($sqlSelect);

 

$image = $row["bannerimage"];

$_SESSION["insertimage"] = $image;

$ext = $row["extension"];

 

 

header("Content-type: $ext");

echo base64_decode($image);

}

 

?>

 

i have retrieve one by one image using this file by this code in whicle loop using different ids

 

<img  width='10%' height='10%' src='controller/image.php?id=$row[idbanner]&page=banner' >

 

Now my problem is when i retrive the image query for all images does not execute but it shows all the images so from where this images come and so i face problem when i update any image i dont get latest image because i am not refreshing page

 

so i want latest image while updating them

 

Link to comment
https://forums.phpfreaks.com/topic/172268-regarding-image-retrieve-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.