Reply to Re: Pulling jpeg name images out of MySQL onto PHP page

Your name:

Reply:


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/

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация