Showing posts with label Database Programming. Show all posts
Showing posts with label Database Programming. Show all posts

Monday, 10 November 2014

Page wise or paginated listing of data from a database table using PHP

This example demonstrates how data from a database table  is displayed as different pages  in a webpage.

In this example records per page is stored in a variable $pagesize and it is set to 15 (you can change it as per your requirements). For each page the query is selecting only the required 15 records and displays it. 
Starting record of the given  page ($pageno) is calculated by the following expression.

 $start_rec = (($pageno-1) * $pagesize) ;

Query to select required number of records starting from start_rec is given below. To specify the starting record and number of records in SQL query the LIMIT clause is used.

Tuesday, 9 September 2014

Database Connection using VB.Net class

This Class, implemented in VB .Net, is  used to connect and execute queries on Microsoft SQL Server database. It uses Data.SqlClient library to perform database operations.

Methods implemented in this class