-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlongest_grand_slam_final_php.php
41 lines (36 loc) · 1.59 KB
/
longest_grand_slam_final_php.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
<?php
include 'FINAL_HEADER.php';
// Connects to the XE service (i.e. database) on the "localhost" machine
$u="jsshah";
$p="Yash!12081997";
$db="oracle.cise.ufl.edu/orcl";
$conn = oci_connect($u,$p,$db);
if(!$conn)
{
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
else
{
$stid = oci_parse($conn,"select t,firstname,lastname,m,s from player, (select * from
(select tid as t,minutes as m,lid as l,wid as w,score as s from tournament_match where tid in (select tid as t from tournament where tname='US Open' or tname='Australian Open' or tname='Roland Garros' or tname='Wimbeldon') and round='F' and minutes is not null order by minutes desc) where rownum<2) where pid=l or pid=w");
$stid1=oci_parse($conn,"select tname from tournament where tid in (select * from (select tid from tournament_match
where tid in (select tid from tournament where tname='US Open' or tname='Australian Open' or tname='Roland Garros' or tname='Wimbeldon') and round='F' and minutes is not null order by minutes desc) where rownum<2)");
$r = oci_execute($stid);
$r1 = oci_execute($stid1);
if(!$r)
{
}
else
{
$num1 = oci_fetch_row($stid);
$num2 = oci_fetch_row($stid);
$num3 = oci_fetch_row($stid1);
$arr = explode ("\-", $num1[0]);
echo "<h3><center>";//" Longest grand slam match - ";
echo " In " . $num3[0] . " ". $arr[0] . ", final was played between <br> " . $num2[1] . " ".$num2[2] .
" and " . $num1[1] . " " .$num1[2] . " whose duration was <b>" . $num2[3] . "</b> minutes <br> with score " . $num1[4]. ". ";
echo"</center></h3><br>";
}
}
?>