Jump to content

Parse error: syntax error, unexpected ';', expecting T_FUNCTION in C:\xampp\htdo


Danny620

Recommended Posts

Parse error: syntax error, unexpected ';', expecting T_FUNCTION in C:\xampp\htdocs\cms\nav.php on line 31

 

<?php 

class Northplanet {

function Nav_Bar(){

	//Select Links From DB 
	require 'mysqli.php';

	$query = "SELECT link, link_title FROM links";  

$result = $mysqli->query($query) or die(mysqli_error($mysqli));

//Links have been found

if($row){

echo '<ul>\n';

while ($row = $result->fetch_object()){

echo "<li><a href=\"$row->link\">$row->link_title</a></li>\n";

	}

	echo '</ul>\n';

}
}

?>

Is this the entire code? There's at least one missing } at the end. Also please indicate which line is 31?

 

Also

if($row){

 

should probably be

 

if($result){

 

I'm pretty sure this exact post was double posted. I answered the other one.. though didn't catch the $row bit.

http://www.phpfreaks.com/forums/index.php/topic,295044.msg1397112.html#msg1397112

Here, double posted pretty much.

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.