> Being relatively new to php, I discovered the following 
 > after about 2 hours of debugging last night and was wondering why???
 > 
 > I had the following code:
 > 
 > if ( $num_results = 0 )
 > {
 >      echo "no records found";
 > }
 > else
 > {
 >      for ($i=0; $i < $num_results; $i++)
 >      {
 >              display record set
 >      }
 > }

 > The duduction...for loops will not work inside else 
 > statements. The question...why?

Your deduction is wrong, they do.  If this is the code that you're
actually using then I suspect that your problem is more in the
conditional you've got in your 'if' statement.  You aren't doing a
compare you're actually setting $num_results to 0.  A comparison is '=='
rather than just '.

--
----------------------------------------------------------------------
Outback Queensland Internet                   ************************
Longreach                                     ** New Web Site Online *
Queensland                                    ************************
Australia                                     W: www.outbackqld.net.au


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to