Warning: mysqli::mysqli() [mysqli.mysqli]: (HY000/2003): Can't connect to MySQL server on 'gz.com' (111) in /home/roscioa/gz.com/classes/Mysql.php on line 9
Warning: mysqli::prepare() [mysqli.prepare]: Couldn't fetch mysqli in /home/roscioa/gz.com/classes/Mysql.php on line 21
Here is the code:
1.<?php
2.
3.require_once 'includes/constants.php';
4.
5.class Mysql {
6.private $conn;
7.
8.function __construct() {
9.$this->conn = new mysqli(DB_SERVER, DB_USER, DB_PASSWORD, DB_NAME) or
10. die('There was a problem connecting to the database.');
11.}
12.
13.
14.function verify_Username_and_Pass($un, $pwd) {
15.
16.$query = "SELECT *
17.FROM users
18.WHERE username = ? AND password = ?
19.LIMIT 1";
20.
21.if($stmt = $this->conn->prepare($query)) {
22.$stmt->bind_param('ss', $un, $pwd);
23.$stmt->execute();
24.
25.if($stmt->fetch()) {
26.$stmt->close();
27.return true;
28.}
29.}
30.
31.}
32.}
Thanks for the help.
This post has been edited by roscioa: 23 March 2009 - 09:00 PM

New Topic/Question
Reply




MultiQuote




|