Having trouble with If (isset(..
Posted: Sat Oct 09, 2010 6:02 pm
I want to make sure there is data in my array before using it. So that I do not get this error:Undefined variable: signedup in C:\wamp\www\Tournaments\tinfo.htm.php on line 33
Here is what I tried, which is odd because I am using the if statement twice.. but I couldn't see any other way to do it. Anyways I get syntax error and I just don't think I am going about this right.
Here is what I tried, which is odd because I am using the if statement twice.. but I couldn't see any other way to do it. Anyways I get syntax error and I just don't think I am going about this right.
Code: Select all
<?php if (isset($signedup))
{ foreach ($signedup as $splayer): }?>
<p>
Player: <?php echo htmlspecialchars($splayer['name'], ENT_QUOTES, 'UTF-8'); ?>.<?php echo htmlspecialchars($splayer['ccode'], ENT_QUOTES, 'UTF-8'); ?>
</p>
<?php if (isset($signedup))
{ endforeach; } ?>