Simple question on retrieving and displaying images.



Newbie question.

I have a database for displaying the names of bed and breakfasts
searched for by the town they are in as below.


<?php
$result = @mysql_query ("SELECT name FROM site01_details WHERE
town='$townsearch' AND code='sleep'");
while ($row = mysql_fetch_array($result))
{ echo '<p>' . $row['name'] . '</p>'; }

?>

I want to also insert an image (of the premises for example) for each
bed and breakfast found.

Assuming a code in each database entry is actually the exact image
name, and all are stored in /images, and all of JPG format and fixed
size, how can I insert the image for each search result found.

Many thanks

Alec

.



Relevant Pages

  • Re: [PHP] Pragmatically changing a "Record Number"
    ... If you want to have a sequential record number, then add that field and alter it as you will, but leave the internal workings of database alone. ... However, if you wish not to understand how all that works, then use the code above -- it will renumber your auto_increment id leaving no gaps. ... It seems that all this is about is displaying a rowcount. ...
    (php.general)
  • Re: [PHP] Links
    ... You have to add the href tags in the html output for the text to be a link........ ... in your while statement or whatever your using to obtains the links from the database already, ... instead of just displaying $link_value, ... Sent from the PHP - General mailing list archive at Nabble.com. ...
    (php.general)
  • Web Developers - Happy Hearts And HDTV! - Lockergnome
    ... Certificate on your MSIIS Web server. ... getting data from a database is only half the problem. ... Zend recently started a series about building rock solid code in PHP. ... which provides bulk database conversion. ...
    (freebsd-questions)
  • Re: Techniques for Vulneability discovery
    ... in mind) so i searched the net for some free database driven software and came ... the first thing i did was grab some info about PHP programming and some MySQL ... I did some more reasearch on different types of web based "input validation" ... PHP and SQL docs, etc.. ...
    (Vuln-Dev)
  • Re: Techniques for Vulneability discovery
    ... in mind) so i searched the net for some free database driven software and came ... the first thing i did was grab some info about PHP programming and some MySQL ... I did some more reasearch on different types of web based "input validation" ... PHP and SQL docs, etc.. ...
    (Security-Basics)