PDA

View Full Version : Weird PHP Error



Chris
09-22-2007, 08:28 AM
Parse error: syntax error, unexpected T_LNUMBER in /home/virilneu/public_html/recipes/search.php on line 58

Line 58 isn't even PHP.



?>

<br /><h3>Search Results</h3><table border = "0" class="rows" style = "border: 1px solid #261C13;"><tr class = "even">

<?


I turn it into php:


echo '<br /><h3>Search Results</h3><table border = "0" class="rows" style = "border: 1px solid #261C13;"><tr class = "even">';

and get the same error, I remove the line entirely....

and get this next error



Parse error: syntax error, unexpected '=' in /home/virilneu/public_html/recipes/search.php on line 64

Like 64 also isn't really php...



while($main = mysql_fetch_array($view)) {
?><td><a href = "/recipes/recipeview.php?rid=<?=$main['id'];?>"><?=$main['recipename'];?></a></li>
<?

The line with the link is 64.

I copied this code verbatim from another script of mine. Works fine there... wth?

Chris
09-22-2007, 08:29 AM
....nevermind.... as soon as I posted I found the error, 20 lines up I was missing a "

Todd W
09-22-2007, 10:37 AM
....nevermind.... as soon as I posted I found the error, 20 lines up I was missing a "

Hardest type of bloody errors to find :flare:

Nico
09-22-2007, 11:59 AM
Yeah, and to make it more complicated...PHP doesn't always give you the exact line number were the error is. So if it gives you an error in a line that has no PHP (or no error), just look a few lines above, like Chris did.

KLB
09-24-2007, 08:11 AM
....nevermind.... as soon as I posted I found the error, 20 lines up I was missing a "

That was going to be my suggestion. Look for a mistake higher up.