-
Notifications
You must be signed in to change notification settings - Fork 0
/
data_class.php
45 lines (32 loc) · 1.05 KB
/
data_class.php
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
<?php
include("db.php");
class data extends db{
function __construct(){
//echo "working";
}
function user_login($t1, $t2){
$q = "SELECT * FROM user WHERE email = '$t1' AND pass = '$t2'";
$recordSet = $this->connection->query($q);
$result = $recordSet->rowcount();
if($result){
header("Location: page1.php");
} else {
header("Location: index.php?msg=Invalid Credentials");
}
}
function artist_login($t1, $t2){
$q = "SELECT * FROM artist WHERE email = '$t1' AND pass = '$t2'";
$recordSet = $this->connection->query($q);
$result = $recordSet->rowcount();
if($result){
$row = $recordSet->fetch(PDO::FETCH_ASSOC);
$login_id = $row['artist_id']; // Assuming the column name is 'login_id'
header("Location: choice.php?login_id=$login_id");
exit;
} else {
header("Location: index.php?msg=Invalid Credentials");
exit;
}
}
}
?>