Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 176307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:51:11+00:00 2026-05-11T13:51:11+00:00

Hello new to PHP and in a bit of a bind. I need to

  • 0

Hello new to PHP and in a bit of a bind. I need to diplay a nav bar PID = ‘nid’ nid is the page i am on so say i am on a page A and page A has 5 sub nav categories(child ID) then they will display on the left side. MY problem here is that the cid and its name are on two different tables..(tables are listed at bottom) Thanks

$navQuery = ‘SELECT * FROM tblnavpc WHERE PID = \”.$nid.’\”; $navQueryResults = mysql_query($navQuery) or die(mysql_error());

$numNavItems = mysql_num_rows($navQueryResults);    echo'<tr> <td>align='left' valign='top' class='medium'><h1>'. $NavName .'</h1></td>      /tr>'; // echo '<br>Nav Items'.  .'<br>';  for($i = 0; $i < $numNavItems; $i++){     $childName = mysql_result($getResults1,$i,'NavName');     $childNavID = mysql_result($navQueryResults,$i,'cID');     echo ' 

align=’left’ valign=’top’ class=’medium’>
href=’cat_ap~pnid~’.$nid.’~nid~’.$childnavID.’~post.htm’>’.$childName.’

    </tr>';   } 

table: tblNavPC
pcid (parent child id)
pid (parent id)
cid (child id)
related navpcdate

Table: tblNav
NavID
NavName
NavDisplayName

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T13:51:12+00:00Added an answer on May 11, 2026 at 1:51 pm

    Sounds like you’re just looking for a join. Your query should be something like this:

    SELECT n.NavDisplayName FROM tblNavPC AS pc     LEFT JOIN tblNav AS n ON n.NavID = pc.cid WHERE pc.pid = $nid; 

    (change the SELECT clause as needed to get the information you need)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hello I'm new to PHP programming and I migrated from ASP .net to PHP..
I am new to PHP, just downloaded it, and wrote a Hello, World! program:
Hello I am new to PHP and I don't know exactaly what does this
hello i got the same problem as php :: new line in textarea? or
Hello Friends I am a newbie programmer and very very new to PHP. I
Hello guys I'm new to php and I discovered that for a database connection
var marker = new google.maps.Marker({ position: myLatlng, map: map, title:Hello World! }); <?php $fd
Hallo I have this script: <? require(lib2/config.inc.php); require(lib2/tpl.class.php); require(lib2/db.class.php); require(lib2/um.class.php); $tpl = new template(templates,
class Hello @hello = hello def display puts @hello end end h = Hello.new
Hello I'm new to ontologies, my assignment is to create an ontology using Protege

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.