SELECT id, name FROM table WHERE name LIKE a%
To change this behaviour, you will need to change sopt parameter in searchoptions in your colModel.
Lets suppose that we want to change the default LIKE a% operator (begins with) with "contains" - i.e LIKE %a% on the field "CustomerID".
Sample code:
<?php require_once 'jq-config.php'; // include the jqGrid Class require_once "php/jqGrid.php"; // include the driver class require_once "php/jqGridPdo.php"; // Connection to the server $conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD); // Tell the db that we use utf-8 $conn->query("SET NAMES utf8"); // Create the jqGrid instance $grid = new jqGridRender($conn); // Write the SQL Query $grid->SelectCommand = 'SELECT OrderID, OrderDate, CustomerID, ShipName, Freight FROM orders'; // Set output format to json $grid->dataType = 'json'; // Let the grid create the model $grid->setColModel(); // Set the url from where we obtain the data $grid->setUrl('grid.php'); // Set some grid options $grid->setGridOptions(array( "rowNum"=>10, "rowList"=>array(10,20,30), "sortname"=>"OrderID" )); //enable toolbarsearch $grid->toolbarfilter = true; //CoustomerID field should be serched with contain operator $grid->setColProperty('CustomerID',array("searchoptions"=>array("sopt"=>array("cn")))); $grid->renderGrid('#grid','#pager',true, null, null, true,true); $conn = null; ?>