Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try:</p> <pre><code># Page Configuration Values $sql = "SELECT * FROM kurchi_pages ORDER BY id LIMIT 1,5"; $site_url = "http://swenflea/swenflea.com/"; # If Neither PAGE or POST are set, mark the HOME link as CURRENT echo '&lt;li'.( !isset( $_GET['page'] ) &amp;&amp; !isset( $_GET['post'] ) ? ' id="current"' : '' ).'&gt;&lt;a href="' . $site_url . '"&gt;Home&lt;/a&gt;&lt;/li&gt;'; echo 'DEBUG: !isset( $_GET[\'page\'] ) = '.!isset( $_GET['page'] ); echo 'DEBUG: !isset( $_GET[\'post\'] ) = '.!isset( $_GET['post'] ); # Perform the SQL Query $res = mysql_query( $sql ); # Check the SQL Result if( !$res ) die( 'ERROR: Unable to Retrieve Pages from Database' ); if( mysql_num_rows( $res )==0 ) die( 'ERROR: No Pages Retrieved from Database' ); # Loop through the Rows echo 'DEBUG: $_GET[\'page\'] = '.( isset( $_GET['page'] ) ? $_GET['page'] : '--' ); echo 'DEBUG: $_GET[\'post\'] = '.( isset( $_GET['post'] ) ? $_GET['post'] : '--' ); while( $row = mysql_fetch_assoc( $res ) ){ echo 'DEBUG: $row[\'url\'] = '.$row['url']; echo 'DEBUG: Match $_GET[\'page\'] = '.( isset( $_GET['page'] ) &amp;&amp; $_GET['page']==$row['url'] ); echo 'DEBUG: Match $_GET[\'post\'] = '.( isset( $_GET['post'] ) &amp;&amp; $_GET['post']==$row['url'] ); $attrs = ''; if( ( isset( $_GET['page'] ) &amp;&amp; $_GET['page']==$row['url'] ) || ( isset( $_GET['post'] ) &amp;&amp; $_GET['post']==$row['url'] ) ){ # Page OR Post Requested - Matches Row $attrs = ' id="current"'; } echo '&lt;li'.$attrs.'&gt;&lt;a href="'.$site_url.$row['url'].'"&gt;'.$row['nav_name'].'&lt;/a&gt;&lt;/li&gt;'; } </code></pre> <p><strong>UPDATE 1</strong></p> <p>Added Debug Messages to code to identify why it is not working as expected.</p> <p><strong>UPDATE 2</strong></p> <p>Fixed one bug in my code, added further Debug Messages.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload