我有两张table,叫 post
以及
pcgames if $_GET['game']; is =action
它将从列类别搜索表柱和pcgames上的操作。
柱状图
id|category |game
------------------
1 | action |cabal
------------------
2 | strategy |blackdessert
------------------
3 | RPG |MUlegend
------------------
4 | action |ragnarok
------------------
pcgames表
id|category |game
-------------------
1 | action |solidsnake
-------------------
2 | action |finalfantasy
-------------------
3 | RPG |kingdomhearts
-----------------
4 | action |tekken
-------------------
结果
no|category |game
------------------
1 | action |cabal
------------------
2 | action |solidsnake
-------------------
3 | action |finalfantasy
-------------------
4 | action |tekken
-------------------
PHP
<?php
$game = $_GET['game'];
$ids = mysqli_real_escape_string($conDB,$id);
$query = "SELECT * FROM `post` WHERE `game` ='" . $game . "'";
$result = mysqli_query($conDB,$query);
while($row = mysqli_fetch_array($result)) {
?>
<li> <a href="./post_list.html"><?php echo $row['title']; ?></a> </li>
<?php }; ?>
1条答案
按热度按时间xpszyzbs1#
我想你的意思是从表post和pcgames中获取数据,并带有分类条件。如果你想这么做。在您的php上尝试以下操作: