-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist.php
More file actions
44 lines (27 loc) · 671 Bytes
/
list.php
File metadata and controls
44 lines (27 loc) · 671 Bytes
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
<?php
if(isset($_GET['channel'])) {
$channel_id = $_GET['channel'];
}
else {
echo 'no channel specified. select one below:<br/>';
$html_mode = true;
}
$html_mode = false;
require_once('CONFIG_DB.php');
$query = "SELECT * FROM podcast_episodes WHERE channel_id = ".$channel_id;
//execute the query.
$episodes = array();
if ($result = mysqli_query($db, $query) ){
while($row = mysqli_fetch_array($result)) {
$episodes []= $row;
}
foreach($episodes as $i => $episode){
$episodes[$i]['date_unix'] = strtotime($episode['date']);
}
/*
echo '<pre>';
print_r($episodes);
echo '</pre>';
*/
echo json_encode($episodes);
} else { echo 'db prob';}