include("connect_oci.php"); $rowperpage = 10; $subsql = "select * from bma_category where cat_grp='1' order by cat_desc"; $substmt = ociparse($conn,$subsql); ociexecute($substmt,OCI_DEFAULT); $schoolsql = "select * from school_tb order by school_name"; $schoolstmt = ociparse($conn,$schoolsql); ociexecute($schoolstmt,OCI_DEFAULT); $newssql = "select bma_trans_id,cat_id,cat_grp,school_code,subject,detail,start_date,last_update from bma_trans where cat_grp='1' order by last_update desc "; $newsstmt = ociparse($conn,$newssql); ociexecute($newsstmt,OCI_DEFAULT); ocifetch($newsstmt); $lastestnews_code = stripslashes(OCIResult($newsstmt, "BMA_TRANS_ID")); $lastestnews_category = stripslashes(OCIResult($newsstmt, "CAT_ID")); $lastestnews_cat_grp = stripslashes(OCIResult($newsstmt, "CAT_GRP")); $lastestnews_school = stripslashes(OCIResult($newsstmt, "SCHOOL_CODE")); $lastestnews_subject = stripslashes(OCIResult($newsstmt, "SUBJECT")); $lastestnews_detail = stripslashes(OCIResult($newsstmt, "DETAIL")); OCIFreeStatement($newsstmt); $temp_detail = substr($lastestnews_detail,0,500); if(($lastestnews_category!="")&&($lastestnews_cat_grp!="")) { $sql_bul_cat_name="select cat_desc from bma_category where cat_id=$lastestnews_category and cat_grp=$lastestnews_cat_grp "; $stmt_bul_cat_name=ociparse($conn,$sql_bul_cat_name); ociexecute($stmt_bul_cat_name,OCI_DEFAULT); ocifetch($stmt_bul_cat_name); $cat_desc=OCIresult($stmt_bul_cat_name,"CAT_DESC"); OCIFreeStatement($stmt_bul_cat_name); } if($lastestnews_school!="") { $sql_bul_school_name="select school_name from school_tb where school_code=$lastestnews_school "; $stmt_bul_school_name=ociparse($conn,$sql_bul_school_name); ociexecute($stmt_bul_school_name,OCI_DEFAULT); ocifetch($stmt_bul_school_name); $school_name=OCIresult($stmt_bul_school_name,"SCHOOL_NAME"); OCIFreeStatement($stmt_bul_school_name); } $file_sql = "select count(*) countrow from bma_attachfile where bma_trans_id = '$lastestnews_code' and cat_grp='1' "; $file_stmt = ociparse($conn,$file_sql); ociexecute($file_stmt,OCI_DEFAULT); ocifetch($file_stmt); $lastestcount_file= stripslashes(ociresult($file_stmt,"COUNTROW")); OCIFreeStatement($file_stmt); ?>
OCIFreeStatement($substmt); OCIFreeStatement($schoolstmt); ocilogoff(); ?>