English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I am using PHP to make a Full-Size Image display page. I'm not using any fancy PHP callup script because everything I have is integrated with SQL. I'm using SQL to just simply execute nothing but the URL of the image that is requested by using WHERE id= and then a GET command for "id" in the address bar.

Thus, in the end, how this would work is the script executes the URL of the image, and then I have on a separate php page, the tags for "> That would work right? And be since the something.php only executes the image URL?

I get the error that there was an unexpected { curly bracket in the area of my while($row) fetch blah blah blah stuff is. Anyone know what the problem is there? I know the syntax is right, so no need to include that code.

2007-01-10 06:12:30 · 2 answers · asked by ? 3 in Computers & Internet Programming & Design

2 answers

Your best bet is to call the php call first , then echo out a variable in your img src tag

ie

Do your sql query to access the table/information from your database then (in this example imagefile is the name of the row in your database that contains the filename of your image. and its assumed that your image is in the same location as your php file (ie root).)

$img = $row['imagefile'];
$display_img .="";

echo "$display_img";
?>

2007-01-10 06:22:25 · answer #1 · answered by arus.geo 7 · 0 0

The best possible way is first of get imge name from your sql query. so first run you script in php file. once you get the result, fatch image name from the result row. after getting image name put it in you html page with tags.

Kindly, follow the example
$id = $_REQUEST['id'];

$sql = "Select * from [your table name here] where image_id[put your field name here] = '".$id."' ";
$rec = mysql_query($sql);

$image_name = $rec[0]['image_name']; //put your field name instead of image name of your image name field

$path =''; //put your image path if it is not the same level where your script is executed.

?>

now in your html page put

answer #2 · answered by lamp_master 1 · 0 0

fedest.com, questions and answers