Get name in breadcrumbs from MySql DB
===

Ok, i've found a way to add this breadcrumbs feature on my project, but i have a trouble on the deepest hierarchy, i just can't make the "name" appear in the middle breadcrumb(line, wich is calling "product.php" in the code), link works  but the name. Here is the code, i hope this look like a real question now, thank you so much for your help.

    <?php
    include("config/conexion.php");
    if($_GET["id"]){ 
	$products = mysql_fetch_object(mysql_query("SELECT * FROM products WHERE id ='$_GET[id]'"));
    }

    function get_lines($id){
	$cat = mysql_fetch_object(mysql_query("SELECT * FROM lines WHERE id = '$id'"));
	return $cat->name;	
    }

    function get_product($id){
	$cat = mysql_fetch_object(mysql_query("SELECT * FROM products WHERE id = '$id'"));
	return $cat->name;	
    }
    ?>

    <a href="index.php" >Home > </a><a href="lines.php" >Product Lines ></a>
    <a href="products.php?id=<?php echo $products->id_line ?>" ><?php if($_GET["id"]){ echo get_lines($_GET["id"], "name"); } ?> > </a>
    <a href="description.php?id=<?php if($_GET["id"]) { echo $_GET["id"],"id"; }  ?>" ><?php if($_GET["id"]){ echo get_product($_GET["id"], "name"); } ?> > </a>

and when it is working it is a success for the product but not for the line, it appears to be getting the id of the product not the id of the line, names appear until product id>6 (same number of lines) and for the other it just say: "trying to get property of non-object" and link works but no the name.

@outis Thank you for reading this! 