首頁  >  文章  >  後端開發  >  社區(php&&mysql)二_PHP教程

社區(php&&mysql)二_PHP教程

WBOY
WBOY原創
2016-07-21 16:05:51908瀏覽

函數sdatetime($str){
    $str=ereg_replace("-","/",$str);
    $str=substr($str,5,strlen($str)-8);
    回傳$str;
}

function reAnum($sid){ //羆萊構計
    .php3");
    $db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']);  
    $q="從bbs_docssql》中選擇,其中sid='$sid'";
    $rs=mysql_db_query($sql['db'],$qsql);
    return mysql_num_rows($rs)
;
function pagebar($pages) {
    global $pgno;
    //全域$pages;
        echo "";
    echo "

";
    echo " ";
    echo " ";
 !=0) {
        $pu=$pgno-1;
        echo " }     
    if($pgno        $pd=$pgno ] a>";         
    }     
    for($i=0;$i ";
            echo "[".($i 1)."]";
          {
            echo "
";
            echo "[".($i 1)."]";
          }
    }
    echo "
";
    echo "";
        echo "                echo "";
    //echo       if($OPEN_LIST ) {
                echo "";                 echo "" ;
            }else {
                           echo "[甶秨槓肈]";
             /a>";
            }
    回顯「」;         
    echo "
";     

}
//====================================== == == =============================================
函數openlist ($sid) {
    全球$援助;
    全域 $PHP_SELF;

    $DROOT=getenv('DOCUMENT_ROOT');
    include("sql.php3");
    $db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']);  
    $qsql="SELECT * from bbs_docs where sid='$sid' order by wdate";
    $rs=mysql_db_query($sql['db'],$qsql);
    //if(mysql_num_rows($rs)==0) return;
    //echo  mysql_num_rows($rs);
    while($row=mysql_fetch_array($rs)) {
        $id=$row['id'];
            $banner=$row['banner'];
            $poster=$row['poster'];
            $views=$row['views'];
            $wdate=sdatetime($row['wdate']);

            echo "";
                則以回復「」;
                    echo "";
                    echo "  $banner";
                    回顯「
」;
       
                則以回復「」;
                則以回復「」;
                    echo $poster;
                則以回復「」;
                echo "";
                    回復中「 」;
        
                echo " ";
                    echo $views;
                則以回復「」;
                echo "";
                    echo 且 $wdate;
                則以回復「」;

            並為「」;
    }

}

//========================================== == ==============================
函數區域() {
    全域$PHP_SELF;
全域$aid,$sid,$pgno;
    全域$OPEN_LIST;
    $showitems=20;
    $
    $db=mysql_connect($sql['host'], $sql['user'] , $sql['passwd']);  
    //============== =================================== =================
    if(!$aid) {
          $qsql="從bbs_area 選擇id";
           $row= mysql_fetch_array($rs);
          $aid=$row['id'];            id) {
        $qsql="從bbs_subj 選擇id,其中help= $aid 依wdate DESC 排序";
        $rs=mysql_db_query($sql['db'],$qsql);
      [' id'];     
    }     

    if(!$pgno) {// 🎜>        $items=0;
        $ qsql="從bbs_subj 選擇id,其中help=$aid 按wdate DESC 排序";
        $rs=mysql_db_query($sql['db'],$q $rs)){
            $id=$row['id'];     
          $項目;
        }
        $pgno=( INT)($items/$showitems);         
    }

    //========================================== == ==================
    $qsql="SELECT * from bbs_area where id=$aid ";
    $rs=mysql_db_query($[' db'],$qsql);
    $row=mysql_fetch_array($rs);
    $banner=$row['banner'];
    $banner=$row['banner'];
  >    $master=$row['master'];
    echo "
$banner
";

    echo "
";
 )=5000echoo00 % wp =1align=center class='tablefont'>";
      echo "";

         ";     
              echo "穓碝ゅ徹:";
    class='tablefont'>";
              echo "";

      echo "";
    echo ""; ";  

    $qsql="從bbs_subj 選擇*,其中help=$aid 按wdate DESC 排序";
    $rs=mysql_db_query' ,$qsql);
    $all=mysql_num_rows($rs);  //行
    $pages=(INT)($/$showitems); // 如何頁
頁    if($pgcount > $all) {  
        $pgno=$pages-1   }
    mysql_data_seek($rs, $pgcount);
    $cnt=0;
    頁面欄($pages);
 =center bgcolor='#6CA6CD'>";
      echo "";
      echo "        echo "";
            只爸";
            echo "萊第>";
               echo "";
        echo "";
        while($row=mycheap 
            $id =$row['id'];
            $banner=$row['banner'];
          $views=$row['views'] ;
            $wdate=sdatetime($row['wdate']);
          "";
                echo "";
         >";
                    echo $poster;
                echo "";
                echo "";
                echo "」;
            echo "";
                echo "
ら循環
";
                    echo "";
                        
」;
                echo "
";
                    echo $docs;
                echo " td>";
                echo "
";
                  echo "
";
                    echo $wdate;
迴聲「
";
    echo"";       

    頁欄($pages);
}
}
待... ..... 

http://www.bkjia.com/PHPjc/315621.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/315621.htmlTechArticlefunction sdatetime($str){ $str=ereg_replace(-,/,$str); $str=substr=substr ($str,5,strlen($str)-8);回傳$str; } function reAnum($sid){ //羆萊絞計$DROOT=getenv('DOCUMENT_ROOT');在...
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn