Alright i have a magic cards site and im trying to pull all of the cards from a certain set if you click on the set on the home page. www(dot)magiccards(dot)me the code on the first page is:
<?php
require("mysqlconnect.php");
$query = "SELECT COUNT(*) AS `Rows`, `set`,id FROM `magic_cards_copy` GROUP BY `set` ORDER BY `set`";
$result = mysql_query($query) or die(mysql_error());
// Print out result
while($row = mysql_fetch_array($result)){
$setlink = $row[1];
$setlink = str_replace(" ", "", $setlink);
$setlink = strtolower($setlink);
$setlink = preg_replace("/[^a-z0-9]./","",$setlink);
$setlink .= "-c-$row[2]";
$setlink .= ".html";
$navigation .= "< href=\"$setlink\">$row[1]</a> <small><i>($row[0])</i></small>";
}
require("template.php");
?>
and the code on the page that comes is:
<?
require("mysqlconnect.php");
$cat=$_GET['cat'];
echo "Category: $cat<br>";
$query = "SELECT * FROM `magic_cards_copy` WHERE id = $cat ";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result);
echo "Set: $row[1]<br>";
?>
how would have the code pull up the cards from each set? any help would be great. this is more of a practice site for me.