What's Wrong With This Query?

wxdqz

New Member
Hi,

Part of my database has a table in it that contains newsgroups. The table has three columns - ID (autogenerated), URL (news:rec.climbing), Category (Climbing) - for example, and I want to pull the URL's from each Category and create links to them. The link would be in the format
<A HREF=http://www.phpbuilder.com/board/archive/index.php/"news:rec.climbing">rec.climbing</A> - rec.climbing.

This is the code I'm trying to use, but that doesn't seem to work :

<?php

$HTTP_GET_VARS[碈ategory碷;
$db = mysql_connect("localhost", "xxxxxx");
mysql_select_db("Outdoors",$db);
$result = mysql_query("SELECT URL FROM newsgroups WHERE Category = ?Category?ORDER BY URL",$db);
echo "<table border=1 width=600>";
echo "<tr><td>";
echo "
";
if ($myrow = mysql_fetch_array($result)) {
do {
printf("<A HREF=http://www.phpbuilder.com/board/archive/index.php/\" %s \">%s</A> - \"%s\"\n", $myrow["URL"], $myrow["URL"], $myrow["URL"]);
} while ($myrow = mysql_fetch_array($result));
echo "
";
echo "</td></tr>";
echo "</table>";
} else {
echo "Sorry, no records were found!";
}
?>

I'm obviously missing an important concept here, but I'm not sure what it is. Any help would be appreciated.

Thanks!
 
Back
Top