Code: Select all
$string=$_GET['string'];
$cat=$_GET['cat'];
$order=$_GET['order'];
$dir=$_GET['dir'];
$sql="SELECT * FROM `test` WHERE `name` LIKE '$string' OR `brand` LIKE '$string' OR `category` LIKE '$string' ORDER BY $order $dir";Moderator: General Moderators
Code: Select all
$string=$_GET['string'];
$cat=$_GET['cat'];
$order=$_GET['order'];
$dir=$_GET['dir'];
$sql="SELECT * FROM `test` WHERE `name` LIKE '$string' OR `brand` LIKE '$string' OR `category` LIKE '$string' ORDER BY $order $dir";Code: Select all
... ORDER BY $order , $dir ...
Code: Select all
$order=$_GET['order'];
$dir=$_GET['dir'];
Code: Select all
$order=id;
$dir=DESC;