Xin Giúp Đơv Về Code Php

Thảo luận trong 'PHP & MYSQL' bắt đầu bởi tiecnuoi, 28/11/13.

  1. tiecnuoi

    tiecnuoi Mới tham gia

    Bài viết:
    1
    Likes :
    0
    như tiêu đề . em cần gộp 3 talb thành 1 tabl . xin xin nhờ các ace giúp đỡ

    PHP:
    elseif( $type == 'new_vn' )
    {
      
    $where "m_type = 1 AND m_cat LIKE '%," IDCATVN ",%' AND m_mempost = 0 ORDER BY m_id DESC";
      
    $num 7;
      
    $number 21;
      
    $link_pages "Song/Viet-Nam.html";
    }
    elseif( 
    $type == 'new_ca' )
    {
      
    $where "m_type = 1 AND m_cat LIKE '%," IDCATHQ ",%' AND m_mempost = 0 ORDER BY m_id DESC";
      
    $num 8;
      
    $number 21;
      
    $link_pages "Song/Au-My.html";
    }
    elseif( 
    $type == 'new_am' )
    {
      
    $where "m_type = 1 AND m_cat LIKE '%," IDCATAM ",%' AND m_mempost = 0 ORDER BY m_id DESC";
      
    $num 9;
      
    $number 21;
      
    $link_pages "Song/Chau-A.html";
    }
     
    Last edited by a moderator: 29/11/13
  2. Mai Vũ

    Mai Vũ Mới tham gia

    Bài viết:
    28
    Likes :
    15
    PHP:
    switch($type){
    case 
    'new_vn':
    $idcat IDCATVN;
    $num 7;
    break; 
    case 
    'new_ca':
    $idcat IDCATHQ;
    $num 8;
    break; 
    case 
    'new_am':
    $idcat IDCATAM;
    $num 9;
    break; 
    }
    $number 21;
    $link_pages "Song/Au-My.html";
    $where "m_type = 1 AND m_cat LIKE '%," $idcat",%' AND m_mempost = 0 ORDER BY m_id DESC";
     
comments powered by Disqus

Chia sẻ trang này