concatenation..... Please help [solved]

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
nutstretch
Forum Contributor
Posts: 104
Joined: Sun Jan 11, 2004 11:46 am
Location: Leicester

concatenation..... Please help [solved]

Post by nutstretch »

I have a table in my database which holds the id to my product. All the images for the various product have the same id. they are all .jpg file type.

To save space in my database, i would like to form the address of the image from the ID

for example

$image = "gifs/" & $row['StyleID'] & ".jpg"

I tried this but it didn't work.

Can anyone tell me if this is possible and what i am doing wrong.

Any help appreciated
Last edited by nutstretch on Tue Feb 03, 2004 3:29 pm, edited 1 time in total.
jaxn
Forum Commoner
Posts: 55
Joined: Fri Jan 16, 2004 1:50 pm
Location: Nashville, TN

Post by jaxn »

Code: Select all

<?php
$image = "gifs/".$row['StyleID'].".jpg";
?>
That is all there is to it. A period "." concatenates.

-Jackson
nutstretch
Forum Contributor
Posts: 104
Joined: Sun Jan 11, 2004 11:46 am
Location: Leicester

Post by nutstretch »

many thanks
Post Reply