>when I echo menu($id) I get the current page's title.
>How do I print it's peers and it's single parent?

You will need a second query to ask for all the children of the parent:

$peer_query = "select id as child_id, title from meta_data where pid =
$peers = mysql_query($query) or error_log(mysql_error());
while (list($child, $child_title) = mysql_fetch_row($peers)){
  echo "$child_title ($child)<BR>\n";

>P.P.P.S. All pages have information provided by this script:
>$fn = explode("/", $_SERVER['PHP_SELF']);
>  $num_of_s = count($fn) - 1;
>  $fn = "$fn[$num_of_s]";
>  $query = "SELECT * FROM meta_data WHERE page_name = '$fn'";
>  $result = mysql_query($query);
>  $num_results = mysql_num_rows($result);
>  $row = mysql_fetch_array($result);
>  $id = $row['id'];
>  $pid = $row['pid'];
>  $title = $row['title'];
>  $description = $row['description'];
>  $keywords = $row['keywords'];
>It is my metadata page and is used all over the place. so why re-query the
>db for it's parent?

I'm saying:
Don't do that.  Don't use * in this first query.  In *ANY* query, specify
*exactly* which columns you need.  You'll be a lot less confused by your
data when you start forcing yourself to be more precise in your code about
what you want.

*CHANGE* the line above to:
$query = "select id, pid, title, description, keywords from meta_data where
page_name = '$fn'";

Then, after you have the $pid, add in the stuff I wrote above.

Like Music?  http://l-i-e.com/artists.htm

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to