|
Posted by Geoff Berrow on 06/06/06 23:33
Message-ID: <1149628332.042353.148890@y43g2000cwc.googlegroups.com> from
MS contained the following:
>I have the connection established from the Web Page to MySql, all I
>want is how to display the image part. Does anyone have any
>straightforward code to show me how to do this? Is there a better way
>that is not too complicated? Remember, I am a newbie.
Assuming you are storing image names and alt text, this should work
$path="/images/"; // absolute path to images directory
$sql="SELECT imagefield, alt_text FROM imagetable";
$result=mysql_query($sql);
while($myrow=mysql_fetch_array($result)){
echo "<img src='$path".$myrow['imagefield']."'
alt='".$myrow['alt_text']."'><br>";
}
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Navigation:
[Reply to this message]
|