I want get couml and put them int new sql for get other tables' latest records.
<?
function latest_cafe($skin_dir="",$rows, $subject_len,$options="")
{
global $config;
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/$config[cf_latest_skin]";
$list = array();
$group_gr_id = "select cm_id FROM `g4_cafe_member` order by cm_id desc";
$cgr_id = mysql_query('$group_gr_id');
print_r('$cgr_id');
$sql = " select bo_table, bo_subject from $g4[board_table]
where gr_id = '$cgr_id'
and bo_list_level <= '$member[mb_level]'
order by bo_table ";
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
{
print_r($cm_id);
$tmp_write_table = $g4[write_prefix].$row[bo_table];
$row2 = sql_fetch(" select * from $tmp_write_table where wr_id = '$row[wr_id]' ");
$list[$i] = $row2;
$list[$i][bo_table] = $row[bo_table];
$list[$i][bo_subject] = $row[bo_subject];
$list[$i][gr_subject] = $row[gr_subject];
$list[$i][href] = "$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id=$row2[wr_id]";
$list[$i][wr_subject] = cut_str($row2[wr_subject], $subject_len, "…");
$list[$i][comment_cnt] = "";
if ($row2[wr_comment])
$list[$i][comment_cnt] = "($row2[wr_comment])";
}
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
The cm_id colum has four values - character.
test1, test2, test3, test4.
what am I missing?
Any comment would be much appreciated.