编辑链接类别

时间:2013-04-27 04:24:53

标签: php mysql menu categories

转储表categoria

的数据

INSERT INTO categoriaidcategdescri)VALUES (1,'行动'), (2,'经典'), (3,'战斗'), (4,'其他'), (5,'拼图'), (6,'赛车'), (7,'射击'), (8,'体育'), (9,'塔防'), (10,'Zombie');

$varCategorias_GameData = "0";
if (isset($_GET["cat"])) {
$varCategorias_GameData = $_GET["cat"];
}
mysql_select_db($database_gameconnection, $gameconnection);
$query_GameData = sprintf("SELECT * FROM jogos WHERE jogos.intCategoria = %s", GetSQLValueString($varCategorias_GameData, "int"));
$GameData = mysql_query($query_GameData, $gameconnection) or die(mysql_error());
$row_GameData = mysql_fetch_assoc($GameData);
$totalRows_GameData = mysql_num_rows($GameData);

<a href="link_categoria.php?cat=1">Action</a>
<a href="link_categoria.php?cat=2">Classic</a>
<a href="link_categoria.php?cat=3">Fight</a>
<a href="link_categoria.php?cat=4">Others</a>
...

我想编辑与catedory列表相关的每个链接,这是在我的数据库中,链接的代码在哪里?我怎样才能编辑每一个?

1 个答案:

答案 0 :(得分:0)

while ($row = mysql_fetch_assoc($result)) {
echo '<a href="link_categoria.php?     cat='.$row['idcateg'].'">'.$row['descri'].'</a>';
 }