Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Файл подключения connection.php
- <?php
- $servername = "localhost";
- $username = "st2014";
- $password = "progress";
- $connection = "";
- try {
- $connection = new PDO("mysql:host=$servername;dbname=st2014", $username, $password);
- $connection->exec('SET NAMES utf8');
- } catch (PDOException $e) {
- echo "Connection failed: " . $e->getMessage();
- }
- ?>
- // Часть кода которая используется в login.php
- $userRequest = $connection->prepare("SELECT username, password FROM t164062_users WHERE username = :username");
- $userRequest->bindParam(':username', $POST['username']);
- $userRequest->execute();
- $user = $userRequest->fetchAll(PDO::FETCH_ASSOC);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement