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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.