-
stoopid php.
why does this give me an unexpected T_ECHO...
PHP Code:
$category = $row[category]
echo("
<a href=\"index.php?view=tutorials\">Tutorial Index</a> > <a href=\"index.php?view=tutorials&category=".$category."\">$category</a> > ".$title."<br />
<table width=\"100%\" style=\"border: 1px solid #BBCDA3;\">
<tr>
<td>$title by - ".$author." ($views Views)</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
".$tutorial."</td>
</tr>
");
echo("
<tr>
<td>
<br /><br />
<a href=\"index.php?view=tutorials&action=report&id=$id\">Report This Tutorial</a>
</td>
</tr>
");
}
echo("
</table>
<br />
");
if (mysql_num_rows($comments) == "0") {
echo("There are no comments!<br />");
the line with the error is the first line on the above script.
-
-
Will you just get lost pls mod wannabe.
-
A cautioned member giving advice ... well yer ryan should be coding section BUT techincally it is to do with web design so this is right forum too.
-
There is a coding section for a reason. ;)
-
Hey Ryan, shouldn't it be:
PHP Code:
$category = $row[category];
echo("
<a href=\"index.php?view=tutorials\">Tutorial Index</a> > <a href=\"index.php?view=tutorials&category=".$category."\">$category</a> > ".$title."<br />
<table width=\"100%\" style=\"border: 1px solid #BBCDA3;\">
<tr>
<td>$title by - ".$author." ($views Views)</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
".$tutorial."</td>
</tr>
");
echo("
<tr>
<td>
<br /><br />
<a href=\"index.php?view=tutorials&action=report&id=$id\">Report This Tutorial</a>
</td>
</tr>
");
}
echo("
</table>
<br />
");
if (mysql_num_rows($comments) == "0") {
echo("There are no comments!<br />");
? You missed off the ; i think.
-
-
Try:
PHP Code:
$category = $row['category'];
echo("
<a href=\"index.php?view=tutorials\">Tutorial Index</a> > <a href=\"index.php?view=tutorials&category=".$category."\">$category</a> > ".$title."<br />
<table width=\"100%\" style=\"border: 1px solid #BBCDA3;\">
<tr>
<td>$title by - ".$author." ($views Views)</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
".$tutorial."</td>
</tr>
");
echo("
<tr>
<td>
<br /><br />
<a href=\"index.php?view=tutorials&action=report&id=$id\">Report This Tutorial</a>
</td>
</tr>
");
}
echo("
</table>
<br />
");
if (mysql_num_rows($comments) == "0") {
echo("There are no comments!<br />");
If that doesn't work I'm unsure, because I only know simple PHP :p
-
no soz.
ty anyway!
im normally good at spotting erros i must just be tired xD
tom get yo fat assss on msn.
-
:( I tried :p
No problem.
Lol, I've been on my DS all day xP
Can't I'm on the really laggy computer =[
-
-
You need a semicolon before the echo function. Is the array named row defined?
-
Joshua i aint getting you >.>
-
Some times you dont need "'s by the $strings
Or, the T_ECHO could be caused by the thing above it.
Another edit
Find:
PHP Code:
$category = $row[category]
Replace with:
PHP Code:
$category = $row;[category]