Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

display/calling gif from database

Status
Not open for further replies.

rk68

Programmer
Jul 15, 2003
171
IN
In an employee master table, I have field which has the path & image file name (gif image)
eg. Emp ID EmpPhoto
1066 /image/1066.gif

How do I call this image from the table & how do I display the same on the screen, as the image will change as & when a employee Id is called.
What's the synthax ?

TIA
Raj
 
What scripting language are you using and what kind of database is this?

 
I'm using PERL CGI and the database is DB2.
 
Have a look at the DBI for perl to select your values from the database.

displaying the image in the browser should be as simple as

Code:
print "<img src=$image><br>$emp_id\n";

--Paul

cigless ...
 
thnks Paul, but that won't help.
The code is as follows:
<tr>
<td width="46"><font face="Arial" size="2">2</font></td>
<td width="190"><font face="Arial" size="2">Person Login Id</font></td>
<td width="146"><font face="Arial" size="2">$array[1]</font></td>
<td colspan="2"><font face="Arial" size="2">
<input type="text" name="loginid" size="25" maxlength="40"></td>
<td width="46">&nbsp;</td>
</tr>
The above code displays the label Person Login Id & next to it displays the ID No. (array 1) which is called from the database & next to that the user can input the login value. I want the person's image next to this & the field Image has the path & image name. for eg. "../per_image/1066.gif"
How do I display the actual gif file using the image field.

Thanks
Raj

 
Where's the path & image name stored, in $array[2]?
If so, just put an image tag in another table cell:
Code:
<td>Image</td>
<td><img src="$array[2]"></td>

Also, you may want to learn to use styles so your code isn't so bloated with <font> tags.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top