-
Notifications
You must be signed in to change notification settings - Fork 0
/
status.php
33 lines (31 loc) · 900 Bytes
/
status.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
<?php
include("connect.php");
$status= $_GET['status'];
$queryd="UPDATE time SET status='$status' WHERE id=1";
$datad=mysqli_query($conn,$queryd);
$query = "SELECT * FROM led ";
$data=mysqli_query($conn,$query);
$numrows = mysqli_num_rows($data);
if($numrows>0)
{
$querya = "SELECT * FROM led WHERE id=1 ";
$dataa=mysqli_query($conn,$querya);
$arraya=mysqli_fetch_assoc($dataa);
echo $arraya['id'];
echo $arraya['state'];
$queryb = "SELECT * FROM led WHERE id=2 ";
$datab=mysqli_query($conn,$queryb);
$arrayb=mysqli_fetch_assoc($datab);
echo $arrayb['id'];
echo $arrayb['state'];
$queryc = "SELECT * FROM led WHERE id=3 ";
$datac=mysqli_query($conn,$queryc);
$arrayc=mysqli_fetch_assoc($datac);
echo $arrayc['id'];
echo $arrayc['state'];
}
else
{
echo "Error in query or no data";
}
?>