Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- print "Login Page Check";
- $db = new PDO('mysql:host=localhost;dbname=webgame;charset=UTF-8', 'user', 'pass');
- $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
- $stmt = $db->prepare("select * from userInfo where userName=? and password=?");
- $stmt->execute(array($_POST['username'], $_POST['password']));
- $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
- if ($rows)
- {
- echo "YES";
- echo $rows['userID']; //right here, it will print out 'Array', and I don't know why
- }
- print " " . $results;
- ?>
Add Comment
Please, Sign In to add comment