更新时间:2023-02-26 10:03:13
删除单引号&来自查询的 * ,以便查询应如下所示。我希望它能奏效。
Remove single quote & * from the query so that query should look like below. I hope it will work.
SELECT Acronym, Full Name, What FROM jargon1 ORDER BY $col $dir
如果不起作用,
可以打印
echo "SELECT Acronym, Full Name, What FROM jargon1 ORDER BY $col $dir";
让我知道你得到了什么?
and let me know what you get?
注意:我认为你想使用反引号(`),但错误地使用单引号。
Note: I think you wanted to use backticks(`), however mistakenly used single quote.
如您所见
echo "SELECT Acronym, Full Name, What FROM jargon1 ORDER BY $col $dir";
打印
SELECT Acronym, Full Name, What FROM jargon1 ORDER BY ASC`
这意味着 $ col
没有打印..请检查 $ col
That means $col
is not printing.. please check what is going wrong with $col
SELECT Acronym, Full Name, What FROM jargon1 ORDER BY columnNameMissing ASC`
^^^^^^^^^^^^^^^^^