Jump to content

Need some help please


karimali831

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/208217-need-some-help-please/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.