Frost-56
13.12.2017 - 13:37
Всем привет. У каждого товара есть поле price с его ценой.
Как сделать запрос в SQL на сортировку если приходят в GET 2 поля amount (цена от) amount2 (цена до) ?
Все уже облазил не нашел. Примерно представляю WHERE price < $_GET['amount']
AllesKlar
13.12.2017 - 13:57
price >= $_GET['amount'] and price <= $_GET['amount2'] and sql_injection = true
_____________
[продано копирайтерам]
Frost-56
13.12.2017 - 16:07
Цитата (AllesKlar @ 13.12.2017 - 14:57) |
price >= $_GET['amount'] and price <= $_GET['amount2'] and sql_injection = true |
Для чего and sql_injection = true ?
и price >= $_GET['amount'] and price <= $_GET['amount2'] не работает почему то
SerginhoLD
13.12.2017 - 20:53
https://www.w3schools.com/sql/sql_between.asp
_____________
"internet explorer всех правильней отображает страницы" ©
VeRTak
13.12.2017 - 23:36
Цитата (AllesKlar @ 13.12.2017 - 13:57) |
and sql_injection = true |
Тогда уж
and sql_injection == true
:lol:
maximka787
19.12.2017 - 14:28
... WHERE `price` BETWEEN '".intval($_GET['amount'])."' AND '".intval($_GET['amount2'])."'
_____________
..Работает - не трогай!