$result = mysql_query("select * from categories");
while ($row = mysql_fetch_assoc($result)) {
$catid = $row["catid"];
$cat_name = $row["cat_name"];
$cat_desc = $row["cat_desc"];
$cat_date = $row["cat_date"];
echo ("<p><a href=\"$PHP_SELF?action=$catid\">$cat_name</a><br>$cat_desc<br>created $cat_date</p>");
}
if ($action == "$catid") {
$result = mysql_query("select linkid from cat_link where catid = $catid");
while ($row = mysql_fetch_array($result)) {
$displaylinks = $row["linkid"];
echo ("$displaylinks"); }
}
what's the problem here? the script outputs nothing. no errors, nothing. is it not possible to do the $action == "$catid" line?
background: i'm trying to create links of categories that when you click it will display links within the category from a table.
thanks!