-5

我正在处理以下查询:

$query2 = 'SELECT * FROM user_uploads WHERE id_user = '.$id_user;

我想通过以下方式订购它:ORDER BY upload_id DESC - 但我不知道如何做到这一点,或者在这种特殊情况下将代码放在哪里。

有人可以帮我吗?谢谢

4

3 回答 3

1

做就是了 :

$query2 = 'SELECT * FROM user_uploads WHERE id_user = '.$id_user.' ORDER BY upload_id DESC';
于 2013-04-20T21:11:28.767 回答
0
$query2 = 'SELECT * FROM user_uploads WHERE id_user = '.$id_user.' ORDER BY upload_id DESC;
于 2013-04-20T21:11:32.017 回答
0

虽然你可以做

$query2 = "SELECT * FROM user_uploads WHERE id_user = $id_user ORDER BY upload_id DESC";

您绝对应该查看参数化查询。谷歌搜索 PDO!

于 2013-04-20T21:12:50.193 回答