function
Button1Click($sender, $params) { //устанавливаем соединение $this->Database1->Open(); //устанавливаем кодировку запросов $sql="SET NAMES cp1251"; $this->Query1->SQL=$sql; $this->Query1->LimitStart='-1'; $this->Query1->LimitCount='-1'; $this->Query1->Open(); $this->Query1->Close(); //выполняем запрос $sql="select id, name from `test`.`users` where name='" . $this->Edit1->Text . "'" . " and pass='" . $this->Edit2->Text . "'"; $this->Query1->SQL=$sql; $this->Query1->LimitStart='0'; $this->Query1->LimitCount='10'; $this->Query1->Open(); //должна быть только одна такая запись if ($this->Query1->readRecordCount()==1) { $this->Label3->Caption="Вход в систему - " . $this->Query1->name; } else { $this->Label3->Caption="Вход в систему - не выполнен"; } $this->Query1->Close(); //закрываем соединение $this->Database1->Close(); } |
//должна быть только одна такая запись if ($this->Query1->readRecordCount()==1) { $this->Label3->Caption="Вход в систему - " . $this->Query1->name; //перенаправляем пользователя на нужную страницу header('Location:unit2.php'); exit(); } else { $this->Label3->Caption="Вход в систему - не выполнен"; } |