PHP active page code - I can't figure out parse error

Posted by dmschenk on Stack Overflow See other posts from Stack Overflow or by dmschenk
Published on 2010-06-06T04:48:35Z Indexed on 2010/06/06 4:52 UTC
Read the original article Hit count: 291

Filed under:
|
|

I'm trying to build an active page menu with PHP and MySQL and am having a difficult time fixing the error. In the while statement I have an if statement that is giving me fits. Basically I think I'm saying that "thispage" is equal to the "title" based on pageID and as the menu is looped through if "thispage" is equal to "title" then echo id="active". Thanks

<?php
    mysql_select_db($database_db_connection, $db_connection);
    $query_rsDaTa = "SELECT * FROM pages WHERE pagesID = 4";
    $rsDaTa = mysql_query($query_rsDaTa, $db_connection) or die(mysql_error());
    $row_rsDaTa = mysql_fetch_assoc($rsDaTa);
    $totalRows_rsDaTa = mysql_num_rows($rsDaTa);

    $query_rsMenu = "SELECT * FROM menu WHERE online = 1 ORDER BY menuPos ASC";
    $rsMenu = mysql_query($query_rsMenu, $db_connection) or die(mysql_error());

$thisPage = ($row_rsDaTa['title']); 
?>


<link href="../css/MainStyle.css" rel="stylesheet" type="text/css" />

<h2><?php echo $thisPage; ?></h2>

<div id="footcontainer">
<ul id="footlist">
<?php   
        while($row_rsMenu = mysql_fetch_assoc($rsMenu)) {
        echo ("   <li" .  <?php if ($thisPage==$row_rsDaTa['title']) echo  id="active"; ?> . "<a href=\"../" . $row_rsMenu['menuURL'] . "\">" . $row_rsMenu['menuName'] . "</a></li>\n");
        }
        echo "</ul>\n";
?>
</div>

<?php
    mysql_free_result($rsMenu);
    mysql_free_result($rsDaTa); 
?>

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql