A quick question about a while loop.

I have a simple code that searches database for all entries and puts one of the fields into a select box on the output page. However, due to a mistake in my untaint routine (which I've fixed) if a visitor entered their name in Japanese characters, the entry into the data base is blank. That means that my simple while loop:

while ($name=$sth->fetchrow_array()) {
print "<option>$name</option>";
}

stops when it hits the blank name. I can also select the ID number..

while (($name, $ID)=$sth->fetchrow_array()) {
print ."<option>$name</option>";
}

Since this is deployed code, I would like to know if this will work before I try it. Will the loop stop when $name is blank, or will it keep running because $ID is NOT blank and stop only when both are blank?

Thanks

Dave


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to