Danny620 Posted April 18, 2010 Share Posted April 18, 2010 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'; } } ?> Link to comment https://forums.phpfreaks.com/topic/198940-parse-error-syntax-error-unexpected-expecting-t_function-in-cxampphtdo/ Share on other sites More sharing options...
Mchl Posted April 18, 2010 Share Posted April 18, 2010 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){ Link to comment https://forums.phpfreaks.com/topic/198940-parse-error-syntax-error-unexpected-expecting-t_function-in-cxampphtdo/#findComment-1044256 Share on other sites More sharing options...
TeddyKiller Posted April 18, 2010 Share Posted April 18, 2010 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. Link to comment https://forums.phpfreaks.com/topic/198940-parse-error-syntax-error-unexpected-expecting-t_function-in-cxampphtdo/#findComment-1044325 Share on other sites More sharing options...
-Karl- Posted April 18, 2010 Share Posted April 18, 2010 I'm pretty sure this exact post was double posted. I answered the other one.. though didn't catch the $row bit. It has been http://www.phpfreaks.com/forums/index.php/topic,295044.0.html Link to comment https://forums.phpfreaks.com/topic/198940-parse-error-syntax-error-unexpected-expecting-t_function-in-cxampphtdo/#findComment-1044326 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.