the following code doesnt do what it is meant to... it is meant to show on the "page load" - a list of categorys and all the tutorials in them categorys.
when you click the category title it goes and shows only that category with the tutorials in that category.
also then when you click the tutorial, it shows the category and the tutorial, date, name and tutorial ID.
this is the code i have which doesnt work:
PHP Code:
$result = mysql_query("SELECT * FROM tutorials");
while($row = mysql_fetch_array($result)) {
$id = $row['id']; // THe tutorial id
$cat = $row['cat']; // The tutorial categorys
$tname = $row['tname']; // The name of the tutorial
$author = $row['author']; // The author of the tutorial
$caption = $row['caption']; // The caption under the tutorial name
$date = $row['date']; // The date when the tutorial was set
$tutorial = $row['tutorial']; // The full complete tutorial
if($_GET['cat'] == "$cat") {
echo("$cat");
echo("<br><br>");
echo("$tname - $date");
echo("<br><br>");
++$i;
} else if($_GET['tut'] == "$tut") {
echo("$tname");
echo("<br>");
echo("$author - $date");
echo("<br><br>");
echo("$tutorial");
} else {
echo("<a href=\"./?p=tutorials&tut=".$tname."\">$tname - $date</a>");
echo("<br><br>");
echo("<a href=\"./?p=tutorials&cat=".$cat."\">$cat</a>");
echo("<br><br>");
}}
mysql_close();
?>
HELP PLEASE!!!
the URl for this page is at: www.xing-designs.com/?p=tutorials
Last edited by 0beron; 04-22-2005 at 10:09 AM..
|