25 |
|
|
26 |
$smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) ); |
$smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) ); |
27 |
|
|
28 |
$sql_where=""; |
$sql_where="where type='c'"; |
29 |
|
|
30 |
if (isset($id)) { |
if (isset($id)) { |
31 |
$sql_where="where id=$id"; |
$sql_where.="and id=$id"; |
32 |
} |
} |
33 |
|
|
34 |
$sth = $dbh->prepare("select id,title,date,body,pic from community $sql_where order by id desc"); |
$sth = $dbh->prepare("select id,title,date,body,pic from news $sql_where order by date desc"); |
35 |
$sth->execute(); |
$sth->execute(); |
36 |
while ($row=$sth->fetchrow_hash()) { |
while ($row=$sth->fetchrow_hash()) { |
37 |
$data[]=$row; |
$data[]=$row; |