displaying results each...
Moderator: General Moderators
displaying results each...
Hi again..while runnig several process, with while, how can i display the results soon as one is finished, without wating untill the others are finished?
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
echo and print are basically the same thing. The only difference is that print can be called using a variable function.
So there's really no difference between,
Mac
PS. If it's not working post some code so that we can help a bit better.
So there's really no difference between,
Code: Select all
print $variable;
// and
echo $variable;PS. If it's not working post some code so that we can help a bit better.
i figured there wasn't much of a diff. but looking at the manual for while, it had print so i was think it might interact differently in that respect. otherwise, i wouldn't see why it would wait until the end.
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Code: Select all
while (conditions) {
echo $variable;
}Code: Select all
while (conditions) {
print $variable;
}Code: Select all
while (conditions) {
$variable .= something;
}
echo $variable;Mac
I mean exactly the same...so..echo at the end fo the while?twigletmac wrote:which is why it would only echo at the end.Code: Select all
I think what he meant was he had something like: їcode]while (conditions) { $variable .= something; } echo $variable;
Mac
actually...what i really mean goes like this:
so thats the deal...hope u can help me
Code: Select all
while(conditions) {
$anotherprocess
if ($anotherprocess) {
HERE GOES THE ECHO OR PRINT?
}
}
OR HERE?- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
If you want the information to display each time the loop goes round:
If you want to put all the information into one long string and echo it once the loop is finished:
Mac
Code: Select all
while(conditions) {
$anotherprocess;
if ($anotherprocess) {
echo $variable;
}
}If you want to put all the information into one long string and echo it once the loop is finished:
Code: Select all
$variable = '';
while(conditions) {
$anotherprocess;
if ($anotherprocess) {
$variable .= $info;
}
}
echo $variable;no, i've had the same problem.... and i'm not sure there is a work around. for example i'll do a really complex MySQL query that ends up returning a thousand or so results. none of the results will show up until they are all finished, then they are all thrown to the page.Jose Arce wrote:it's not workin for me......i guess webservers hate me jeje...
it may be a long shot, but you may see what ticks do. they are designed to execute every nth time through a loop... not sure if you could set n=1 and have the tick print your stuff.... it's worth looking into at least.
http://www.php.net/manual/en/control-st ... eclare.php