cooldude832 Posted June 23, 2008 Share Posted June 23, 2008 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 More sharing options...
DarkWater Posted June 23, 2008 Share Posted June 23, 2008 Are you using eval() anywhere? PHP treats line numbers inside eval()'d code seperately from normal code. Link to comment https://forums.phpfreaks.com/topic/111568-fugly-line-number-error/#findComment-572644 Share on other sites More sharing options...
cooldude832 Posted June 23, 2008 Author Share Posted June 23, 2008 I know the line number in the code so I know its that echo line thats failing. I do use eval Link to comment https://forums.phpfreaks.com/topic/111568-fugly-line-number-error/#findComment-572650 Share on other sites More sharing options...
DarkWater Posted June 23, 2008 Share Posted June 23, 2008 Show me 5 lines before and after that line. Also, why do you use eval()? =X Link to comment https://forums.phpfreaks.com/topic/111568-fugly-line-number-error/#findComment-572653 Share on other sites More sharing options...
cooldude832 Posted June 23, 2008 Author Share Posted June 23, 2008 Its that line cause another echo at that point works fine. eval is because its pulling out of a database Link to comment https://forums.phpfreaks.com/topic/111568-fugly-line-number-error/#findComment-572654 Share on other sites More sharing options...
DarkWater Posted June 23, 2008 Share Posted June 23, 2008 Can I see the lines anyway? =X And is there a particular reason for storing PHP code in the database to be eval()'d? Not nit-picking, just not a big fan of eval(). Link to comment https://forums.phpfreaks.com/topic/111568-fugly-line-number-error/#findComment-572656 Share on other sites More sharing options...
cooldude832 Posted June 23, 2008 Author Share Posted June 23, 2008 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 Link to comment https://forums.phpfreaks.com/topic/111568-fugly-line-number-error/#findComment-572659 Share on other sites More sharing options...
DarkWater Posted June 23, 2008 Share Posted June 23, 2008 Try: echo '<table border="1" align="center">'; Link to comment https://forums.phpfreaks.com/topic/111568-fugly-line-number-error/#findComment-572663 Share on other sites More sharing options...
cooldude832 Posted June 23, 2008 Author Share Posted June 23, 2008 it works but it makes no sense why its not happy and the error is so ambiguous. Link to comment https://forums.phpfreaks.com/topic/111568-fugly-line-number-error/#findComment-572668 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.