echo

echo

am 28.03.2007 08:52:39 von elk dolk

--0-451004823-1175064759=:87368
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit


I am storing just the name of photos in the database and the photos are in /img folder ,
and there is no permissions issue. My testing server is IIS And the path would be
something like this : Inetpub\wwwroot\album\img
as I am running out of time! could someone complete this code just with one echo and img src so that I can retrive my photos ?

MySQL columns : photoID=seq number
photoFileName=name of my photo like 3sw.jpg
title=title
description=short description



$link = mysql_connect('localhost', 'root', 'pw');
if (!$link) {
die('Not connected : ' . mysql_error());
}

$db_selected = mysql_select_db('album', $link);

$query = "SELECT * FROM photo";
$result=mysql_query($query);

while ($row = mysql_fetch_array($result))
{
////echo???

}

mysql_free_result($result);

?>

---------------------------------
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.
--0-451004823-1175064759=:87368--

Re: echo

am 28.03.2007 08:56:09 von dmagick

elk dolk wrote:
> I am storing just the name of photos in the database and the photos are in /img folder ,
> and there is no permissions issue.

So it's a path issue.

You need to reference the image as:



--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: echo

am 28.03.2007 10:22:38 von Dimiter Ivanov

> something like this : Inetpub\wwwroot\album\img
> as I am running out of time! could someone complete this code just with one echo and img src so that I can retrive my photos ?
>
> MySQL columns : photoID=seq number
> photoFileName=name of my photo like 3sw.jpg
> title=title
> description=short description
>
>
> >
> $link = mysql_connect('localhost', 'root', 'pw');
> if (!$link) {
> die('Not connected : ' . mysql_error());
> }
>
> $db_selected = mysql_select_db('album', $link);
>
> $query = "SELECT * FROM photo";
> $result=mysql_query($query);
>
> while ($row = mysql_fetch_array($result))
> {
> ////echo???
>
> }
>
> mysql_free_result($result);
>
> ?>
>

The path would be relative to your web root folder.

in your case


or if you are testing on your own machine use

or if you need it to work for outside connections :


i suggest using the relative path.

while ($row = mysql_fetch_array($result)) {
echo "
}

P.S.

Chris sorry for accidentaly sending it only to you the first time..

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php