='" . $gYMD . "' ORDER BY `date` ASC LIMIT 1"; $qry = mysql_query( $sql, $dbh ) or die( mysql_error()); $id = mysql_result( $qry, 0, "id" ); } $sql = "SELECT `tbl_theme`.`theme` as `theme`, `tbl_message`.`id` as `id`, `tbl_message`.`radioname` as `radioname`, `tbl_message`.`message` as `message` FROM `tbl_theme` LEFT OUTER JOIN `tbl_message` ON `tbl_theme`.`id`=`tbl_message`.`theme_id` WHERE `tbl_theme`.`id`='" . $id . "' ORDER BY `tbl_message`.`time` DESC"; $array_data = ReadDBData( $sql, $dbh ); //print_r($array_data); // select menu $str_select = MakeBackNumber2( $id, $dbh, "theme" ); db_close( $dbh ); //--------------------------- // replace $tpl_index = str_replace( "[+++ SELECT MENU +++]", $str_select,$tpl_index ); //--------------------------- // echo echo "$tpl_index"; ?>