JavaScript
- 17 ответов
- 0 вопросов
12
Вклад в тег
$name = mysql_real_escape_string($_GET['name']);
$detailModel = mysql_real_escape_string($_GET['detail_model']);
$city = mysql_real_escape_string($_GET['city']);
$sql = "SELECT `id`, `model`, `detal`, `data`, `prosmotry`, `gorod`, `oblast`" .
"FROM `auto` WHERE `detal` LIKE '%$name%'" .
($detailModel ? " AND `model` LIKE '%$detailModel%'" : "") .
($city ? " AND `gorod` LIKE '%$city%'" : "");