PHP Parser Error. Is PHP going crazy??
Posted: Sun Aug 27, 2006 10:00 pm
Everah | Please use
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??
Everah | Please use
Code: Select all
,Code: Select all
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]Code: Select all
<?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>";
?>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??
Everah | Please use
Code: Select all
,Code: Select all
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]