-
Notifications
You must be signed in to change notification settings - Fork 0
/
results.php
45 lines (32 loc) · 1.15 KB
/
results.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
42
43
44
45
<?php //results.php
require_once 'functions.php';
require_once 'header.php';
database_connect($dbhost, $dbuser, $dbpass, $dbname);
$query = 'SELECT * FROM nyitevents WHERE Event="'.sanitizeString($_GET['category']).'"';
$result = queryMysql($query);
if(!$result) die('Database access failed: '.mysql_error());
$rows = mysql_num_rows($result);
echo "<div class='container-fluid table-responsive'>";
echo "<table class='table table-striped table-hover table-bordered'>";
echo "<tr><th>Name</th><th>Description</th><th>Date</th><th>Time</th><th>Location</th></tr>";
for($j=0; $j<$rows; ++$j){
$row = mysql_fetch_row($result);
echo "<tr>";
echo "<td>".$row[0]."</td>";
echo "<td>".$row[1]."</td>";
echo "<td>".$row[2]."</td>";
echo "<td>".$row[3]."</td>";
echo "<td>".$row[4]."</td></tr>";
}
if($rows==0){
echo "<tr><td colspan='5'><img src='img/noFlexZone.png' />
<h2>It ha no events dawg</h2></td></tr>";
}
echo "</table></div>";
mysql_close(mysql_connect($dbhost, $dbuser, $dbpass));
?>
<script src="js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>