anantamu.com


PHP MySQL Limit


LIMIT is used to get the particular the number of records from the table.


LIMIT CLAUSE

SELECT columnNames FROM tableName WHERE columnNames=value LIMIT 10;

Show the perticular data from table

Displaying the records from Profile table.

<?php
$servername = "localhost";
$username1 = "root";
$password1 = "";
$dbname = "sample";
//server connection
$connection = mysqli_connect($servername, $username1, $password1, $dbname);
if (!$connection) {
die("Connection failed: " . mysqli_connect_error());
}
$sqlQuery='select * from profile WHERE ID="1"  LIMIT 10 ';


$resultSql=mysqli_query($conn, $sqlQuery);
echo '<table>'
echo '<tr><td>Name</td><td>phonenumber</td></tr>';

if (@mysqli_num_rows(@$resultSql) >= 1) {
// output data of each row
  while ($rowValue = mysqli_fetch_assoc($resultSql)) {
	  echo '<tr>';
	  echo '<td>'.$rowValue['name'].'</td>;
	  echo  '<td>'.$rowValue['phonenumber'].'</td>';
	  echo '</tr>';

  }
}else{	
	echo '<tr><td>no records found</td><td></td></tr>';
}
echo '</table>'
mysqli_close($conn);
?> 

LIMIT 10 is used to get first 10 records, It is used for pagination functionality.



List of All 223 Banks



Bank IFSC CODE