簡體   English   中英

使用php在url中獲取標簽

[英]Get tags post in url with php

我在調用 get post URL 時遇到問題,我通過“標簽”調用 post 不顯示。

我的網址:

本地主機/asd/列表/電影

我想調用標簽“電影”但不顯示,我使用代碼:

$tags = $_GET['Tags'];
$test = "SELECT * FROM `test1` ORDER BY Tags = '$tags' DESC";

我想在 URL 中顯示我正在調用的內容。

也許這里有人可以幫助我解決問題。

如果要過濾匹配條件的數據,請使用WHERE子句

因此,您更新后的查詢將如下所示:

$test = "SELECT * FROM `test1` WHERE Tags = '".$tags."' ORDER BY DESC";

在您的網址中使用: localhost/asd/list/ ?Tags=movie

和你的 sql 命令 $test = "SELECT * FROM test1 ORDER BY Tags = ' $Tags ' DESC";

注意大寫的 T。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM