function ep_latestt($showid){
/* Function to bring back an array of latest show information */
mysql_connect(config(dbserver),config(dbusername),config(dbpassword));
mysql_select_db(config(dbname));
if(isset($showid) && is_numeric($showid)){
$query = "SELECT * FROM SHOWINFO WHERE SHOW_ID = '".$showid."'";
$result = mysql_query($query)or die(mysql_error().$query);
if(mysql_num_rows($result) == 1){
//$query "SELECT * FROM EPLIST WHERE SHOW_ID = '".$showid."'";
$query = "SELECT * FROM EPLIST WHERE SHOW_ID = '".$showid."' AND EP_AIRDATE >= unix_timestamp(CURDATE())";
$result = mysql_query($query)or die(mysql_error().$query);
$array = mysql_fetch_array($result);
var_dump($array);
}
}
}
==========
The array that outputs is:
array(22) {
[0]=>
string(3) "405"
["ID"]=>
string(3) "405"
[1]=>
string(4) "2445"
["SHOW_ID"]=>
string(4) "2445"
[2]=>
string(3) "169"
["EP_ID"]=>
string(3) "169"
[3]=>
string(16) "Day 8: Episode 1"
["EP_NAME"]=>
string(16) "Day 8: Episode 1"
[4]=>
string(1) "8"
["EP_SEASON"]=>
string(1) "8"
[5]=>
string(10) "1263686400"
["EP_AIRDATE"]=>
string(10) "1263686400"
[6]=>
string(44) "http://www.tvrage.com/24/episodes/1064812687"
["EP_LINK"]=>
string(44) "http://www.tvrage.com/24/episodes/1064812687"
[7]=>
string(53) "[There is no summary added for this episode]
»"
["EP_SYN"]=>
string(53) "[There is no summary added for this episode]
»"
[8]=>
string(28) "images/epimages/2445.169.jpg"
["EP_PIC"]=>
string(28) "images/epimages/2445.169.jpg"
[9]=>
string(21) "vids/eps/2445.169.flv"
["EP_VID"]=>
string(21) "vids/eps/2445.169.flv"
[10]=>
string(5) "08x01"
["EP_NUM"]=>
string(5) "08x01"
}
|