$sqlParam=array();
if ($SearchTitle)
{
$SearchText=trim($SearchTitle);
$sqlAdd=" WHERE (mc_account.Title LIKE ? OR mc_account.Gsm LIKE ?)";
array_push($sqlParam,'%'.$SearchTitle.'%','%'.$SearchTitle.'%');
}
if ($sqlAdd && $StockName) {$sqlAdd.=' AND (';} else if ($StockName) {$sqlAdd.=' WHERE (';}
if ($StockName) {
$sqlAdd.=" mc_stock.StockName = ? )";
array_push($sqlParam,$StockName);
}
if ($sqlAdd && $sFinishDate) {$sqlAdd.=' AND (';} else if ($sFinishDate) {$sqlAdd.=' WHERE (';}
if ($sFinishDate) {
$sqlAdd.=" mc_member.FinishDate <= ? )";
array_push($sqlParam,$sFinishDate);
}
bunu kendinize göre düzenleyin.