while else statement? PHP -



while else statement? PHP -

so have validation in null values using while statement code is

while (!$rs->eof){ echo "<tr><td>".$rs->fields("branch")."</td>"; $rs->movenext(); } $rs->close(); ?>

what wanted accomplish have "else" statement though know not possible using statement. 1 equivalent of in statement?

while (!$rs->eof){ echo "<tr><td>".$rs->fields("branch")."</td>"; $rs->movenext(); } if(!$rs->eof) { echo "<tr><td> branch missing</td>"; } $rs->close(); ?>

i tried using "if" didn't errors though didn't print wanted print

while-else not exists in php.

you use:

if ($rs->eof) { echo "<tr><td> branch missing</td>"; } else { while (!$rs->eof){ echo "<tr><td>".$rs->fields("branch")."</td>"; $rs->movenext(); } } $rs->close();

php

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -