NASDAQ (usa) arrow 6715.56 -12.11 -0.18%
FTSE 100 (london) arrow 7487.96 -5.12 -0.07%
DAX (german) arrow 13465.51 235.94 1.78%
NIKKEI 225 (japan) arrow 22420.08 408.47 1.86%
Hang - Seng (hong kong) arrow 28594.06 348.52 1.23%
NIFTY - 50 (india)
Straits Times (singapore) arrow 3391.61 17.53 0.52%
KOSPI (korea) arrow 2556.47 33.04 1.31%
All Ordinaries (australia) arrow 6005.30 28.90 0.48%
BOVESPA (brazil) arrow 74092.76 -215.73 -0.29%
0)) { // This variable is set to zero for the first page $start = 0; } $eu = ($start -0); $limit = 50; // No of records to be shown per page. $this1 = $eu + $limit; $back = $eu - $limit; $next = $eu + $limit; /////////////// WE have to find out the number of records in our table. We will use this to break the pages/////// $query2="SELECT symbol,DailyOpen,DailyHigh,DailyLow,5min_close,PerChg,PriChg,5min_volume FROM 5min_mkt_temp"; $result2=$con->query($query2) or die($con->error);//mysql_query($query2); echo $con->error; $nume=$result2->num_rows;//mysql_num_rows($result2); /////// The variable nume above will store the total number of records in the table//// /////////// Now let us print the table headers //////////////// $bgcolor="#f1f1f1"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; ////////////// Now let us start executing the query with variables $eu and $limit set at the top of the page/////////// $query=" SELECT symbol,DailyOpen,DailyHigh,DailyLow,5min_close,PerChg,PriChg,5min_volume FROM 5min_mkt_temp where 5min_volume > '0' ORDER BY `PerChg` ASC limit $eu, $limit "; $result=$con->query($query) or die($con->error);//mysql_query($query); echo mysql_error(); //////////////// Now we will display the returned records in side the rows of the table///////// while($noticia = $result->fetch_array($result)) { if($bgcolor=='#f1f1f1'){$bgcolor='#ffffff';} else{$bgcolor='#f1f1f1';} echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
 Symbol Open High Low LTP Percent Change Volume
 $noticia[symbol] $noticia[DailyOpen] $noticia[DailyHigh] $noticia[DailyLow] ".$noticia['5min_close']." $noticia[PerChg] $noticia[PriChg] ".$noticia['5min_volume']."
"; ////////////////////////////// End of displaying the table with records //////////////////////// ///// Variables set for advance paging/////////// $p_limit=50; // This should be more than $limit and set to a value for whick links to be breaked if(!empty($_GET['p_f'])) { $p_f=$_GET['p_f']; } else { $p_f=0 ; } // To take care global variable if OFF if(!($p_f > 0)) { // This variable is set to zero for the first page $p_f = 0; } $p_fwd=$p_f+$p_limit; $p_back=$p_f-$p_limit; //////////// End of variables for advance paging /////////////// /////////////// Start the buttom links with Prev and next link with page numbers ///////////////// echo "
"; if($p_f<>0){print "PREV $p_limit"; } echo ""; //// if our variable $back is equal to 0 or more then only we will display the link to move back //////// if($back >=0 and ($back >=$p_f)) { print "PREV"; } //////////////// Let us display the page links at center. We will not display the current page as a link /////////// echo ""; for($i=$p_f;$i < $nume and $i<($p_f+$p_limit);$i=$i+$limit){ if($i <> $eu){ $i2=$i+$p_f; echo " $i "; } else { echo "$i";} /// Current page is not displayed as link and given font color red } echo ""; ///////////// If we are not in the last page then Next link will be displayed. Here we check that ///// if($this1 < $nume and $this1 <($p_f+$p_limit)) { print "NEXT";} echo ""; if($p_fwd < $nume){ print "NEXT $p_limit"; } echo "
"; ?>