【小(xiǎo)編推薦】維信科(kē)技(jì),遍α☆曆數(shù)據IN查詢,将數(shù)組作 δ(zuò)為(wèi)查詢條件(jiàn),用(yòng)implode方法≠↕

2015-09-16   | &nbsε'ε∏p; 發布者:梁國(guó)芳  &♦σnbsp;|   查看(kàn→€  ):3320次

php
 <?php 
header("Content-Type: te↔ββ∑xt/html; charset=utf-8");
define('DT_REWRITE', tr♥♣✘ue);
require '../common.inc.php';
 
error_reporting(E_ALL);
$A = array();
 
$res = $db->query("sele↔δπct catid FROM weixinβσ‌_category where parentid='$_GET[cat&βid]' order by catid desc&q&✔uot;);
 
while($rb = $db->f™₹‍etch_array($res)) {
$A[]=$rb['catid'];
}
array_push($A,$_GET['catid']);
//var_dump($A);
$id=implode(',',$A);
//echo $id;
/*foreach($A as $k=&÷♦‍αgt;$v) {
$str.=$v.',';
}*/
 
$rt = $db->query("select * ₽$FROM weixin_down_31 where catid IN ($id∑↓/*注意此處不(bù)要(yào)加引号,否則sql不(bù)識别*/₽ ¶') order by itemid desc")≠λ;
while($ra = $db->fetch_arraα≠y($rt)){
?>
<dd>
      &nbs♦$p;          δ"γ   <div class="s_tu&quo♣>λ£t;>
        φσ₩         &  ↔↕nbsp;       <img srφ c="<?php echo $ra♥ ↔×['thumb'];?>"×®€↓ />
        &n • ¥bsp;          ✔λ       <div class=&qu↔♦ot;s_ind">
      &n♣γ↔®bsp;         &nb ★sp;         &nbs₩β"p; <div class="s_ind_wen"↕÷÷≈;>
         ‍©          ×↕;       &nbsε₹☆p;     <p><?p∑Ω↑₹hp echo $ra['jianjie'±λ≈π];?></p>
          &‌₩ ≥nbsp;       &nbs♥β×p;         β↓∑</div>
        &π±       &σ'±↕nbsp;      ε‌ ;   </div>
        &nb♥  sp;         &nbs↓♣®p; </div>
      &nbs₽₹✘£p;          ↕₹α•;   <div class="s_×™Ωwen">
      &nbs‍™±®p;       ±          &∞∑   <h2 title="&$£lt;?php echo $ra['tit≤∞★φle'];?>"><σλ↕?php echo $ra['title'];?>&lα±&™t;/h2>
       €™;       &nbs​←÷p;      σ"   <ul>
        &n¶γδbsp;        ​♦¶;        ≈✘φ;   <li>實施院校(xiào):≥±¶<?php echo $ra['school'];?>&>♥lt;/li>
          &nb‌₹sp;     &n♦γ∏bsp;          ≥α  <li>實施時(shí)間(jiān):<> ¶β;?php echo $ra['schooltime'];?>₹ε</li>
        &nb₹✘₹sp;       &nb ¶sp;         &nbs ✘p; <li>方案提供方:<?php echo $ra['g₽☆★★iver'];?></li>
     ‌✘±↔           &n​φσ★bsp;       <±☆→/ul>
      &nb‌€≥sp;       &nb≈¶sp;      ‌π    <a href="<☆β•?php echo $ra['fileurl'];?>α≠₽;">文(wén)檔下(xià)載</a>
       ₩α;        φπ©;     </div>
       ↔¥✘↓;         </dd&α≠♣gt;
<?php }
 
?>