<?php
include $_SERVER['DOCUMENT_ROOT'].'/includes/helpers.inc.php';
$search_q=$_POST['search'];
$l= mysqli_connect('localhost', 'root', '', 'air');
$search_q = trim($search_q);
$search_q = strip_tags($search_q);
$q= mysqli_query($l, "SELECT id_passengers, psurname, pname, patrongmic, date_of_birth, passport, issued_by, date_of_issue, login, password, phone FROM `passengers` WHERE psurname LIKE '%$search_q%'");
$itog=mysqli_fetch_assoc($q);
try {
$query = 'SELECT id_passengers, psurname, pname, patrongmic, date_of_birth, passport, issued_by, date_of_issue, login, passwors, phone FROM passengers';
$result = $pdo->query($query);
}
catch (PDOException $e) {
echo "Ошибка выполнения запроса: ".$e->getMessage();
include 'error.php';
exit();
}
while ($row = $result->fetch())
{
$prod[] = array('id_passengers' => $row['id_passengers'],
'psurname' =>$row['psurname'],
'pname' =>$row['pname'],
'patrongmic' =>$row['patrongmic'],
'date_of_birth'=>$row['date_of_birth'],
'passport'=>$row['passport'],
'issued_by'=>$row['issued_by'],
'date_of_issue'=>$row['date_of_issue'],
'login'=>$row['login'],
'password'=>$row['password'],
'phone'=>$row['phone']);
}
}
mysqli_free_result($q);
mysqli_close($l);
include_once 'rezult.php';
unset($_POST['search_sub3']);
unset($search_sur);
exit();
?>
______________________________________________________
Помогите пожалуйста решить такую проблему. Не могу реализовать поиск :с
Что делаю не так? И как исправить?
Вопрос задан
более трёх лет назад
756 просмотров