Limit No. Of MYSQL Data
<p>I'm using MySQL to show data on my website: <a href="http://www.onlinedealsindia.in" rel="nofollow">http://www.onlinedealsindia.in</a>. You can see the deals (deal boxes) there but I want to limit them. I want only 50 deals (deal boxes) to show up per page. Clicking the more button would show the next 50 deals.</p>

<p>Below is my code to get data from MySQL:</p>

<pre><code>&lt;?php           
$host="localhost";      
$username="username";       
$password="pass";       
$dbname="DB NAme";      
$conn=new mysqli($host, $username, $password, $dbname); 
if($conn-&gt;connect_error)        
{               
die("error".$conn-&gt;connect_error);      
}           
else { echo "";}    

$sql= "SELECT * FROM table ORDER BY p_id DESC";

$results=$conn-&gt;query($sql);    
if($results-&gt;num_rows &gt; 0)
{ while($row=$results-&gt;fetch_assoc())   
{   $pid=$row["p_id"];  
?&gt;  
</code></pre>