Welcome! Log In Create A New Profile

Advanced

loops

Posted by Shaun2010 
Announcements Last Post
Announcement : Programming Students at UNISA School of Computing 06/19/2019 02:01PM
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
avatar loops
April 20, 2011 08:12AM
Is it possible to take this and add the results into a variable? (It's in a loop)

Language: PHP
echo $row['fname'] . ' ' . $row['sname'] . ' - ' . $row['email'].'<br />';

I tried but I only get the first result.

Language: PHP
$text = $row['fname'] . ' ' . $row['sname'] . ' - ' . $row['email'].'<br />';

A word to the wise ain't necessary - it's the stupid ones that need the advice.
Student Number:72793775
Re: loops
April 20, 2011 08:31AM
try this

Language: PHP
$text .= $row['fname'] . ' ' . $row['sname'] . ' - ' . $row['email'].'<br />';

or this

Language: PHP
$text = $text . $row['fname'] . ' ' . $row['sname'] . ' - ' . $row['email'].'<br />';

--

Student Number: 7298-786-3
avatar Re: loops
April 20, 2011 10:48AM
Thanks smiling smiley

A word to the wise ain't necessary - it's the stupid ones that need the advice.
Student Number:72793775
avatar Re: loops
April 20, 2011 07:57PM
AHA! Let me try this too smiling smiley
avatar Re: loops
April 20, 2011 08:26PM
WORKED! Awesome smiling smiley
Re: loops
May 07, 2011 09:01AM
It can also be done like this

$text[] = $row... ...
Sorry, only registered users may post in this forum.

Click here to login