PHP5 - Infinit loop by WHILE

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
User avatar
macek
php-forum Active User
php-forum Active User
Posts: 277
Joined: Wed Aug 25, 2010 10:42 am
Contact:

Re: PHP5 - Infinit loop by WHILE

Post by macek » Wed Jul 31, 2013 10:53 pm

Code: Select all


$res_Total = mssql_query($query_Total));
while ($Total = mssql_fetch_array($res_Total)) {
  print_r( $Total );
 echo '<hr />';
}  


johnj
php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: PHP5 - Infinit loop by WHILE

Post by johnj » Fri Aug 02, 2013 2:15 am

Code: Select all

$i = 0;
$res_Total = mssql_fetch_array(mssql_query($query_Total));
while (count($res_Total) > 0 && $i < count($res_Total))
{
print $Total = $res_Total[0]." - ";
$i = $i + 1;
}  

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests