Jump to content

Fugly Line Number Error


cooldude832

Recommended Posts

I'm getting this fugly error on this line and I can't see it

 

Parse error: syntax error, unexpected T_LNUMBER, expecting ',' or ';' in /********/index.php(35) : eval()'d code(32) : eval()'d code on line 39

 

this is valid

<center><h1>Kids Fishing Contest</h1></center><br /><br />
<ul class="body_text">
<li><a href="http://www.upperstraitscleanlake.org/images/08kidsfish.pdf" target="_blank">Information Sheet</a></li>
</ul>
<br /><br />
<p class="body_text">
This year we are attempting to take a survey of the species of the lake and their density so please bring back all fish to the weigh in to be included in the survey
</p>
<br />
<p class="body_text">
The results are in! The table below list all the catches from largest to smallest
</p>



</p>
<?php
ConnectSQL();
define("ANGLERS_TABLE", "anglers");
define("FISH_TABLE", "fish_species");
define("CATCHES_TABLE", "catches");
		$fields = array(
			ANGLERS_TABLE.".Name as Name",
			ANGLERS_TABLE.".Division as Division",
			FISH_TABLE.".Name as Species",
			CATCHES_TABLE.".Weight as Weight",
			CATCHES_TABLE.".Length as Length",
			CATCHES_TABLE.".Date as Catch_Date",
			CATCHES_TABLE.".CatchID as CatchID"
			);
		$fields = implode(" , ", $fields);
		$q = "Select ".$fields." 
		from `".CATCHES_TABLE."`
		left join `".ANGLERS_TABLE."` on (".ANGLERS_TABLE.".AnglerID = ".CATCHES_TABLE.".AnglerID)
		left join `".FISH_TABLE."` on (".FISH_TABLE.".SpeciesID = ".CATCHES_TABLE.".SpeciesID)
		Group By ".CATCHES_TABLE.".CatchID
		Order By ".ANGLERS_TABLE.".Division, ".CATCHES_TABLE.".Length ASC, ".CATCHES_TABLE.".Weight ASC, ".CATCHES_TABLE.".Date";
		$r = mysql_query($q) or die(mysql_error()."<br /><br />".$q);
?>

 

adding on the line to the end

<?php
echo "<table border=\"1\" align=\"center\">";
?>

Gives the error

 

I'm stumped

Link to comment
https://forums.phpfreaks.com/topic/111568-fugly-line-number-error/
Share on other sites

because my cms is run through .htaccess mods + mysql backing so I can full text index my pages.

 

The error is commin on quoted intgers (so border=\"1\" is owning me)

 

the eval isn't the issue

 

u can see the whole thing but it won't matter

<?php
<center><h1>Kids Fishing Contest</h1></center><br /><br />
<ul class="body_text">
<li><a href="http://www.upperstraitscleanlake.org/images/08kidsfish.pdf" target="_blank">Information Sheet</a></li>
</ul>
<br /><br />
<p class="body_text">
This year we are attempting to take a survey of the species of the lake and their density so please bring back all fish to the weigh in to be included in the survey
</p>
<br />
<p class="body_text">
The results are in! The table below list all the catches from largest to smallest
</p>



</p>
<?php
ConnectSQL();
define("ANGLERS_TABLE", "anglers");
define("FISH_TABLE", "fish_species");
define("CATCHES_TABLE", "catches");
		$fields = array(
			ANGLERS_TABLE.".Name as Name",
			ANGLERS_TABLE.".Division as Division",
			FISH_TABLE.".Name as Species",
			CATCHES_TABLE.".Weight as Weight",
			CATCHES_TABLE.".Length as Length",
			CATCHES_TABLE.".Date as Catch_Date",
			CATCHES_TABLE.".CatchID as CatchID"
			);
		$fields = implode(" , ", $fields);
		$q = "Select ".$fields." 
		from `".CATCHES_TABLE."`
		left join `".ANGLERS_TABLE."` on (".ANGLERS_TABLE.".AnglerID = ".CATCHES_TABLE.".AnglerID)
		left join `".FISH_TABLE."` on (".FISH_TABLE.".SpeciesID = ".CATCHES_TABLE.".SpeciesID)
		Group By ".CATCHES_TABLE.".CatchID
		Order By ".ANGLERS_TABLE.".Division, ".CATCHES_TABLE.".Length ASC, ".CATCHES_TABLE.".Weight ASC, ".CATCHES_TABLE.".Date";
		$r = mysql_query($q) or die(mysql_error()."<br /><br />".$q);
		echo "<td>";
			echo "<table border=\"1\" align=\"center\">";
			echo "<tr>";
				echo "<td colspan=\"6\"><h1>Smallest Fish</h1></td>";
			echo "</tr>";
			echo "<tr>";
				echo "<td>Name</td>";
				echo "<td>Species</td>";
				echo "<td>Length (in.)</td>";
				echo "<td>Weight (lbs.)</td>";
				echo "<td>Time</td>";
				echo "<td>Division</td>";
			echo "</tr>";
		while($row = mysql_fetch_assoc($r)){
			if($division != $row['Division']){
				echo "<tr><td colspan=\"6\"><center><h3>DIVISION: ".$row['Division']."</h3></center>";
			}
			$division = $row['Division'];
			//print_r($row);	
			echo "<tr>";
				echo "<td>".$row['Name']."</td>";
				echo "<td>".$row['Species']."</td>";
				echo "<td>".$row['Length']."</td>";
				echo "<td>".$row['Weight']."</td>";
				echo "<td>".date("g:i:s a",strtotime($row['Catch_Date']))."</td>";		
				echo "<td>".$row['Division']."</td>";
			echo "</tr>";
		}
		echo "</table>";
?>

 

Its in quoting numbers I think

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.