$nnomer = $_POST['nnomer']; // то самое слово lux
$query = "SELECT datestart, dateend FROM main WHERE namenomer = '$nnomer'";
$pdo = new PDO(/* параметры соединения с БД */);
$result = $pdo->prepare('SELECT datestart, dateend FROM main WHERE namenomer = :namenomer');
$result->execute([':namenomer' => empty($_POST['nnomer' ]) ? '' : $_POST['nnomer']]);
try{
$db = new PDO("dbtype:host=yourhost;dbname=yourdbname;charset=utf8","username","password");
}catch(PDOException $e ){
die( "Error: ".$e);
}
$query=$db->prepare("SELECT datestart, dateend FROM main WHERE namenomer = ?");
$query->execute(array($nnomer));
while($row=$query->fetch(PDO::FETCH_OBJ)) {
}