我正在处理以下问题:
$query2 = 'SELECT * FROM user_uploads WHERE id_user = '.$id_user;
我想订购它:ORDER BY upload_id DESC - 但我仍然坚持如何做到这一点,或者将代码放在这个特殊情况下的位置。
是的,有人能帮帮我吗? 感谢答案 0 :(得分:1)
只是做:
$query2 = 'SELECT * FROM user_uploads WHERE id_user = '.$id_user.' ORDER BY upload_id DESC';
答案 1 :(得分:0)
$query2 = 'SELECT * FROM user_uploads WHERE id_user = '.$id_user.' ORDER BY upload_id DESC;
答案 2 :(得分:0)
虽然你可以做到
$query2 = "SELECT * FROM user_uploads WHERE id_user = $id_user ORDER BY upload_id DESC";
你一定要查看参数化查询。 Google for PDO!