Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post 
Post Question About While Function 
 
Hi!

Can someone of you explain me the difference between this two functions and which should i use in standard?

Code: [Download] [Hide] [Select]
    if ($row = $db->sql_fetchrow($result))
    {
        $i = 0;
        do
        {
            // php funcs

            $template->assign_block_vars('iprow', array());

            $i++;
        }
        while ($row = $db->sql_fetchrow($result));
    }


Code: [Download] [Hide] [Select]
    while ($row = $db->sql_fetchrow($result))
    {
            // php funcs

            $template->assign_block_vars('iprow', array());

            $i++;
    }


Thanks!
 




____________

Play Games at GamesCampus!
 
KugeLSichASend private messageVisit poster's website  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: Question About While Function 
 
The do{}while(); execute one time at least.
 



 
InformproSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Question About While Function 
 
Thanks! Informpro

now i also found the function on php.net.... yesterday i cant find it  

http://www.php.net/manual/en/control-structures.do.while.php
 




____________

Play Games at GamesCampus!
 
KugeLSichASend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Question About While Function 
 
It's not a function ...
 



 
InformproSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Question About While Function 
 
I would use the WHILE.

Anyway it's a matter of personal taste.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Question About While Function 
 
Yes, but you're right: while is better, we don't rewrite the $sql->fetch_rowset, DRY :p
 



 
InformproSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Question About While Function 
 
ok thank you guys
 




____________

Play Games at GamesCampus!
 
KugeLSichASend private messageVisit poster's website  
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events


  

 

  cron