-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathupdatenotiread.php
More file actions
38 lines (27 loc) · 899 Bytes
/
updatenotiread.php
File metadata and controls
38 lines (27 loc) · 899 Bytes
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
<?php
session_start();
include("dbconnect.php");
$userid=$_SESSION["userid"];
$usertype = $_SESSION['usertype'];
if($usertype==="startup")
{
// $mentornotiquery="select notificationread from mentorship
// inner join users where mentorid=userid and startupid=$userid and status='accepted' and notificationread=0 order by statuschangetime desc limit 50";
$mentornotiquery = "update mentorship set notificationread=1 where startupid=$userid and status='accepted' and notificationread=0";
$mentornotiresult=mysqli_query($conn,$mentornotiquery);
}
$query="update enlighten set notificationread=1 where requestorid=$userid and status='accepted' and notificationread=0";
$result=mysqli_query($conn,$query);
if($usertype==="startup"&&$result&&$mentornotiresult)
{
echo "success";
}
else if($usertype!=="startup"&&$result)
{
echo "success";
}
else
{
echo "error";
}
?>