woocha Posted December 17, 2007 Share Posted December 17, 2007 Hey Guys... I have a quick question and I am hoping you can help... I am pulling data from a Mysql DB and the code looks like this: $file1 = $r['item_numb']; this works just fine but I need to concat and extension to $r['item_numb']; so that if $r['item_numb']; equates to 210210, I need $file1 toe be 210210.txt This way I can take a piece of information from a db and turn it into a file name. Thank you Link to comment https://forums.phpfreaks.com/topic/82078-solved-php-to-pull-infor-from-mysql-and-create-a-text-file-name/ Share on other sites More sharing options...
craygo Posted December 17, 2007 Share Posted December 17, 2007 <?php $file1 = $r['item_numb']; if($file1 == "210210"){ $file1 .= '.txt'; } echo $file1; ?> Ray Link to comment https://forums.phpfreaks.com/topic/82078-solved-php-to-pull-infor-from-mysql-and-create-a-text-file-name/#findComment-417065 Share on other sites More sharing options...
woocha Posted December 17, 2007 Author Share Posted December 17, 2007 That worked brilliantly, Thanks Ray Link to comment https://forums.phpfreaks.com/topic/82078-solved-php-to-pull-infor-from-mysql-and-create-a-text-file-name/#findComment-417071 Share on other sites More sharing options...
craygo Posted December 17, 2007 Share Posted December 17, 2007 NP Link to comment https://forums.phpfreaks.com/topic/82078-solved-php-to-pull-infor-from-mysql-and-create-a-text-file-name/#findComment-417072 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.