ok
this is how I start.
theres a set of links that derive from a database
when a link is clicked
you are fowarded to a page called list.php
in this page
i want to get certain information out of the database based on what link is clicked
so this is how it works
$result = mysql_query("SELECT name FROM cat_categories WHERE ref = 1 ORDER BY name ASC")
or die(mysql_error());
while ($row = mysql_fetch_assoc($result))
{
echo '<a href="list.php?name=' . urlencode($row['name']) . '">'
. htmlspecialchars($row['name']) . "</a><br />\n";
}
the above code creates the links list
now in list.php i need to figure out which link is clicked and produce the corresponding add on list.php
$name = $_GET['name'];
echo $name . '<br><br>';
$nameId = mysql_query("SELECT name FROM cat_categories WHERE name='$name'");
now $_GET = which link is clicked
in my table cat_categories there is a 'name' and 'id' columns
now the information in $_GET comes from column 'name'
now I need to get the 'id' from the row $_GET came from??
understand?