Forums
This topic is locked
adding a value to data pulled from MySQL
Posted 27 Feb 2004 19:58:00
1
has voted
27 Feb 2004 19:58:00 Gordon Burleigh posted:
What I am trying to accomplish is to have the file path added to the name of my image In my database in my DreamWeaver code so I don't have to type the file path for every single image in the database.I have a field 'thumb' in which I will store the names of my imgaes. Of course for the images to display I need to include the file path.
If my file path was photo/family/ is there away to append it to the statement below.
<?php echo $row_rsengine['thumb']; ?>
If not then for every image in my database I would have to type
/photo/family/imagename.jpg
It would be better if I could just type
imagename.jpg in MySQL and add then include the file path in the code in DreamWeaver
Yes, I am new to this. To help me learn PHP and dynamic sites with Dreamweaver I am working on a test project of an inventory of my Dad's HO train
collection.
Any suggestions would be appreciated.
Replies
Replied 29 Feb 2004 02:30:03
29 Feb 2004 02:30:03 Phil Shevlin replied:
<?php echo "photo/family/".$row_rsengine['thumb']; ?>
The dot (.) is the way to concatenate with php
Edited by - wdglide on 29 Feb 2004 02:30:30
The dot (.) is the way to concatenate with php
Edited by - wdglide on 29 Feb 2004 02:30:30
Replied 14 Apr 2007 16:34:11
14 Apr 2007 16:34:11 Alan Austin replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
<?php echo "photo/family/".$row_rsengine['thumb']; ?>
The dot (.) is the way to concatenate with php
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
How would you do it to display images stored in an array where the name stored in the array needs ".jpg" concatenated to it to give its exact location?
i.e. something like
<php echo "images/".$my_array".jpg"; ?> kind of thing...
Note that this is in the middle of a loop through the array, constructing the image location from the name+.jpg, to display the image. Should also include HTML like
<php echo "<img src = 'images/..etc"...
Alan<b></b><b></b>
<?php echo "photo/family/".$row_rsengine['thumb']; ?>
The dot (.) is the way to concatenate with php
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
How would you do it to display images stored in an array where the name stored in the array needs ".jpg" concatenated to it to give its exact location?
i.e. something like
<php echo "images/".$my_array".jpg"; ?> kind of thing...
Note that this is in the middle of a loop through the array, constructing the image location from the name+.jpg, to display the image. Should also include HTML like
<php echo "<img src = 'images/..etc"...
Alan<b></b><b></b>