从index.php到detail.php

i have a troubles with my code.

I have html table in index.php (php, mysql)..this:

<?php
    require ('../../inc/config.inc.php');
    require ('../../inc/ini.php');
    mysql_set_charset('utf8');
    $sql = "SELECT * FROM {$cfg['tbl_dily']}";
    $result = mysql_query($sql)or die(mysql_error());

    echo "<table class=\"vypis\">";
    echo "<h1 id=\"vypis\">Nabídka náhradních dílů</h1>
";

    $i = 0; //defaultní hodnota pro obarvení řádku

    //start cyklu pro výpis z tbl_dily
    while ($row = mysql_fetch_array($result)){
        //přístup ke sloupcum tbl_dily
        $part_id    =$row['part_id'];
        $img150     =$row['img150'];
        $nazevdilu  =$row['nazev'];
        $vyrobce    =$row['vyrobce'];
        $model      =$row['model'];
        $cena       =$row['cena'];

        //start --- coloring every 2nd row of table
        $i=1-$i;
        $trclass="radek".$i;
        //end --- coloring every 2nd row of table
        echo "<tr class=\"".$trclass."\">
";
            if($img150 == null){ // podmínka pro existenci fotografie produktu
                echo "<td class=\"img150\"> <a href=\"./detail.php?id=".$part_id."\"> <img class=\"obrazek\" src=\"fotoneni.gif\"/> </a> </td>
";
            }
            else {
                echo "<td class=\"img150\"> <a href=\"./detail.php?id=".$part_id."\"> <img class=\"obrazek\" src=\"".$img150."\"/> </a> </td>
";
            }
            echo "<td class=\"nazevdilu\"><a href=\"./detail.php?id=".$part_id."\">".$nazevdilu."</a></td>
";
            echo "<td class=\"modely\">".$vyrobce." ".$model."</td>
";
            if($cena == 0){ //podmínka pro existenci přesné ceny produktu nebo "dohodou"
                echo "<td class=\"cena\">dohodou</td>
";
            }
            else{
                echo "<td class=\"cena\">".$cena." Kč"."</td>
";
            }
            echo "</tr>
";
    }
    //konec cyklu pro výpis z tbl_dily
        echo "</table>
";
?>

So I have linked out part_id with no problems. Problems shows when I want to see detail of some product. My detail.php looks like this now:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">

<head>
<?php
require ('../../inc/config.inc.php');
require ('../../inc/ini.php');
mysql_set_charset('utf8');
$part_id=$_GET['part_id'];
$data = mysql_query("SELECT * FROM {$cfg['tbl_dily']} WHERE part_id='$part_id'") or die(mysql_error());
while ($detail = mysql_fetch_array($data)){
$id =$detail['part_id'];
}
?>
<title><?php $id; ?></title>
</head>
<body>
<div class="detail">
    <span id="detail_id">Výpis nabídky id <?php $id; ?></span>
    <div class="detail_foto">
    </div>
    <div class="detail_info">
    </div>
</div>
</body>
</html>

I need to help at least with getting part_id number in page title of detail.php. I dont understand so much how $_GET works..I hope you somebody show me how-to..

THANKS for helping me out:))

Your explanation is not terribly nice. You should maybe edit the Question and explain where the problem is at. But for now, let me just explain '$_GET'

'$_GET' is a way to deliver Data from one PHP Script to another. You can find them in almost every Formular. As you can see in the Code below, there is a simple way that sends Data to an "action.php" - the attribute "method" is for telling the formular what you want to do. You should maybe take a look at both options because GET displays the data you want to deliver in the link. Your user could start manipulating that which would be a very unsafe thing in your case because you work with mysql-Databases. Also you should take a look at Mysql String escaping.

Back to the topic: The HTML below would redirect $_GET['name'] AND $_GET['age'] to the action.php where you can work with those.

<form action="action.php" method="get">
<p>Your ame: <input type="text" name="name" /></p>
<p>Your age: <input type="text" name="age" /></p>
<p><input type="submit" /></p>
</form>