-
Notifications
You must be signed in to change notification settings - Fork 3
/
checkdate.php
40 lines (39 loc) · 870 Bytes
/
checkdate.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
<?php
$text=$_GET["text"];
$date=$_GET["date"];
$servername = "localhost";
$username = "Daniel Davidraj";
$password = "password";
$dbname = "daniel davidraj";
// Create connection
$conn = mysqli_connect($servername,$username,$password,$dbname);
// Check connection
if (!$conn)
{
die("Connection failed: " . mysqli_connect_error());
}
$sql="SELECT `Vehicle`,`Date` FROM `package`";
$result=mysqli_query($conn,$sql);
$rowsnum=mysqli_num_rows($result);
$i=0;
if ($rowsnum > 0)
{
while($row = mysqli_fetch_assoc($result))
{
if($row["Vehicle"]==$text && $row["Date"]==$date)
{
break;
}
$i++;
}
}
if($i==$rowsnum)
{
echo 0;
}
else
{
echo 1;
}
mysqli_close($conn);
?>