Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function ConectarBD()
- {
- $server = "localhost";
- $db = "ssrpdb";
- $user = "root";
- $pass = "52160967";
- try
- {
- $pdo = new PDO("mysql:host=$server;dbname=$db", $user, $pass);
- }
- catch(PDOException $e)
- {
- echo"<script type='text/javascript'> window.alert('NAO FOI POSSIVEL SE CONECTAR COM O BANCO DE DADOS');</script>". $e->getMessage();
- exit();
- }
- }
- function SelectDB()
- {
- $pdo = ConectarBD();
- $BUSegura = $pdo->prepare("SELECT * FROM accounts WHERE Username=:user OR Password= :pass");
- $BUSegura->bindValue(":user", "Sr.AloneZ");
- $BUSegura->bindValue(":pass", "52160967");
- $BUSegura->execute();
- echo $BUSegura->rowCount();
- echo $BUSegura['user'];
- }
- SelectDB()
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement