-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdatabase.php
More file actions
49 lines (33 loc) · 1.09 KB
/
Copy pathdatabase.php
File metadata and controls
49 lines (33 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
include('connection.php');
class database{
var $connect;
var $server=SERVER;
var $user=USER;
var $password=PASS;
var $db=DB;
public function __construct(){
$this->connect=mysqli_connect(SERVER, USER, PASS, DB) or die("<script>alert('Problem Connecting Database.Please try after sometime.')</script>");
if(!$this->connect){
echo"<script>alert('Problem Connecting Database.Please try after sometime.')</script>";
}
}
public function fireQuery($query){
$r=mysqli_query($this->connect,$query);
if(!$r){
echo"<script>alert('Process Failure')</script>";
}
return $r;
}
public function validateCredentials($userid,$password){
$qry="select * from users where userid= '".$userid."' and password= '".$password."';";
$result=$this->fireQuery($qry);
if(mysqli_affected_rows($this->connect)>=1){
return $result;
}
else{
return null;
}
}
}
?>