Get multiple records with limit clouse

SELECT SQL_CALC_FOUND_ROWS * FROM <tablename> limit 0,10;
SELECT FOUND_ROWS();

$row = mysql_fetch_row(mysql_query(“SELECT FOUND_ROWS()”));
$total = $row[0];

We can get totat records by using above query.

This is for very large records.

This speeds up the query and page execution.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.