-
Notifications
You must be signed in to change notification settings - Fork 1
/
attempt.php
35 lines (32 loc) · 876 Bytes
/
attempt.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
<?php
//when song stops playing then get a signal and make played=1;
//after this if user not select a song to be played then play one song from queue whose played=0; if played=0;song not found then play played=1 song
//status = 1 when user intervention is not there
$sig=$_GET['status'];
include('config.php');
if($sig==1)
{
// get uid
$u="SELECT * FROM user_details WHERE `email`='$user' ";
$r=mysqli_query($con,$u);
$row=mysqli_fetch_array($r);
$uid=$row["uid"];
//get songs from queue whose played=0
$u="SELECT * FROM queue WHERE `played`='0' ";
$r=mysqli_query($con,$u);
if(mysqli_num_rows($r)==0)
{
$row=mysqli_fetch_array($r);
$song_name=$row["song_name"];
//add code to play this song
}
else
{
$u="SELECT * FROM queue WHERE `played`='1' ";
$r=mysqli_query($con,$u);
$row=mysqli_fetch_array($r);
$song_name=$row["song_name"];
//add code to play this song
}
}
?>