Hi all. Total newbie here, so please forgive my naivete..
I have a site with posters and their descriptions stored in a MySql database. There are several fields, all VARCHAR, and the script I’m quoting below works fine, but it shows broken image icons.
While I know that I should upload jpegs to a folder on the server and
only store filename in a database field (which I did), I’m confused with the
following :
1.
Where exactly should the picture folder “images” be on the server ?
Anywhere in the “www” folder ? Within the folder that contains the
“post-query.php” file ?
Which of the following should be in the database field :
a. [url]http://www.mysite.com/images/123.jpeg
b. [url]www.mysite.com/images/123.jpeg
c. /images/123.jpeg
d. images/123.jpeg
e. /123.jpeg
f. 123.jpeg
3. Correspondingly, should the php code read (field name in mysql table is called ‘Code’):
a. if($line
[Code] !=””){
echo “<img
src=”http://www.mysite.com/images/”.$row[‘fileName’].””>”;
}else{
$pic=” – “;
}
b. if($line[Code] !=””){
echo “<img
src=”www.mysite.com/images/”.$row[‘fileName’].””>”;
}else{
$pic=” – “;
}
c. if($line[Code] !=””){
echo “<img
src=”images/”.$row[‘fileName’].””>”;
}else{
$pic=” – “;
}
4. The html I have reads as follows (all fields before <img src> are text fields and work fine) :
[code=html]
PRINT(“<TR BGCOLOR=$bgcolor><TD>$num.</TD><TD>$auth</td><TD>$title</TD><TD>$original_title</TD><TD>$country</TD><TD>$director</TD><TD>$cast</TD><TD>$year</TD><TD>$original_year</TD><TD>$producer</TD><TD>$circ</TD><TD>$size</TD><TD>$print</TD><TD><img src=”=$row{[‘fileName’]
}”></TD><TD>$remarks</TD></TR>”);
Begging for help ! I’ve spent hours on Google and while everyone agrees that storing urls in mysql is the way to go, no one gives a single example !!!
Thanx
Tom ?