PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
<?php
//grab all of the league_ids and names from the database
$query = "SELECT league_id, league_name FROM league";
$result = pg_query( $query );
$num_leagues = pg_numrows( $result );
// build a select box that containes the names of all the different leauges
echo "<select name='league_id'>";
for ( $i = 0; $i < $num_leagues; $i++ ) {
$id = pg_result( $result, $i, "league_id" );
$name = pg_result( $result, $i, "league_name" );
echo "<option value='". $id . "'>" . $name . "</option>";
}
echo "</select>";
?>
I am getting a "Parse error: parse error, unexpected '}' in /home/btcamp2/public_html/fantasykickoff/v1/register.php on line 79"
First off, there is NO line 79 in my file. The <?php starts on line 159 and the ?> is on line 173. When i remove the echo that is inside the for loop, i dont get that error. Is there something wrong with my echo??
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
i know where the error is happening but i dont understand why. If you remove the echo that i have inside that forloop, then the parser error dosnt come up, but if i put it back, it says unexpected }. WTF!!!