Can’t use function return value in write context in

Can’t use function return value in write context in error

With this code:

if (!empty($_GET('price'))){
$by = price;
}else{
$by = NAME;
}
if (!empty($_GET('price'))){
$order = $_GET['price'];
}else{
$order = ASC;
}

How to do the same? 🙂


Answer 1, authority 100%

$_GET(‘price’)

should be changed to

$_GET['price']

Answer 2

What is NAME and ASC ? maybe you meant ‘NAME’ and ‘ASC’
And in general your code is not safe. Or are you making a platform for learning SQL injection?