jdimino Posted August 20, 2008 Share Posted August 20, 2008 Hi Everyone I would like to an extension to a value. for example .$BloomName. I would like to add either .jpg, jpe, .gif or Leaf.jpg can someone Help me please $query="insert into ihsreg (SubmitEmail,Bloom_Name,Pod_Name,Pollen_Name,Hybridiser,Origin,Grower,Color_Group,Bloom_Type,Reg_Mini,Size_Range,Propagation,Bloom_Color,Bloom_Characteristics,Leaf_Characteristics,Bush_Characteristics,Photo_Credit,Bloom_Image,Pod_Image,Pollen_Image,Hybridiser_Image,Leaf_Image,Cross_Made,Registrant_Name,date) values ('".$SubmitEmail."','".$BloomName."','".$PodName."','".$PollenName."','".$Hybridiser."','".$Origin."','".$Grower."','".$ColorGroup."','".$BloomType."','".$RegMini."','".$SizeRange."','".$Propagation."','".$BloomColor."','".$BloomCharacteristics."','".$LeafCharacteristics."','".$BushCharacteristics."','".$PhotoCredit."','".$BloomName."','".$PodName."','".$PollenName."','".$Hybridiser."','".$BloomName."','".$CrossMade."','".$RegistrantName."','".$date."')"; mysql_query($query); Link to comment https://forums.phpfreaks.com/topic/120487-adding-an-extension-to-a-filename/ Share on other sites More sharing options...
Fadion Posted August 20, 2008 Share Posted August 20, 2008 If this is as easy as it seems to be, you just need to use string concatenation. <?php $bloomName = 'somevalue'; //the original variable $ext = 'jpg'; //the extension $bloomName = $bloomName . '.' . $ext; //concatenate the two variables with a dot to separate the extension //then insert it into the db ?> Link to comment https://forums.phpfreaks.com/topic/120487-adding-an-extension-to-a-filename/#findComment-620896 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.