"; echo "
กรุณาทำการ Login ก่อน
execQuery($query); $numrows = $dbObj->_numrows; /** Paging */ $display = ( !isset ($_GET['page']) ) ? 1 : $_GET['page']; $start = ( ($display * $limit) - $limit ); /** Paging */ if( isset($_GET['OrderBy']) ) { if( $keyword != "" ) { // ใส่ Keyword $query = " SELECT * FROM $myTable WHERE ReTyId='1' and ($myTableField1 LIKE '%$keyword%' OR $myTableField2 LIKE '%$keyword%' ) ORDER BY $OrderBy $ASCDESC "; } else { $query = " SELECT * FROM $myTable Where ReTyId='1' ORDER BY $OrderBy $ASCDESC "; } } elseif( !isset($_GET['OrderBy']) ) { if( $keyword != "" ) { // ใส่ Keyword $query = " SELECT * FROM $myTable WHERE ReTyId='1' and ($myTableField1 LIKE '%$keyword%' OR $myTableField2 LIKE '%$keyword%' ) ORDER BY $myOrderBy ASC "; } else { $query = " SELECT * FROM $myTable Where ReTyId='1' ORDER BY $myOrderBy DESC"; } } $query .= " LIMIT $start, $limit "; $result = $dbObj->execQuery($query); ?> |