karimali831 Posted July 19, 2010 Share Posted July 19, 2010 Hi When I use echo $row['column']; I will get all rows in the column but when I use $variable.=$row['column']; and define $variable on my templates file, I only get one of the rows. I know it is because it is outside the loop but it must be outside so is there another way? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/208217-need-some-help-please/ Share on other sites More sharing options...
PFMaBiSmAd Posted July 19, 2010 Share Posted July 19, 2010 but it must be outside No it mustn't. You put code where it needs to be to accomplish the stated goal. Your loop is iterating over the result set. If you want each successive value to be concatenated with $variable, you must either do that inside of the loop or you must store all the values in an intermediate array and then concatenate them after the end of the loop. Quote Link to comment https://forums.phpfreaks.com/topic/208217-need-some-help-please/#findComment-1088318 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.