Hello guys im new in PHP and I code a multi search value (3 select inputs) and all works perfect but i dont have an idea to create the pagination for this code, this is the code i have can you please tell me how to do the pagination ?


HTML Code:

<form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method='POST'>
	<select name="opt1">
		<option selected>all</option>
		<option value="apartamentos">Apartamentos</option>
		<option value="nave">Naves</option>
		<option value="penthouse">Penthouse</option>
		<option value="residencia">Residencias</option>
		<option value="villa">Villas</option>
	<select name="opt2">
		<option selected>all</option>
		<option value="santo domingo">Santo Domingo</option>
		<option value="santiago">Santiago</option>
		<option value="samana">Samana</option>
		<option value="punta cana">punta cana</option>
	<select name="opt3">
		<option selected>all</option>
		<option value="terrenas">terrenas</option>
		<option value="bavaro">bavaro</option>
		<option value="naco">naco</option>
	<input type='submit'>

PHP Code:

include ("conexion.php");
$opt1 $_POST['opt1'];
$opt2 $_POST['opt2'];
$opt3 $_POST['opt3'];
$result mysql_query(" SELECT * FROM `inmuebles` WHERE tipo = '".$opt1."' OR ciudad = '".$opt2."' OR sector = '".$opt3."'  "); 
            if (
mysql_num_rows($result)) {
"<ul id='tiles'>";
                while (
$row mysql_fetch_array($result)) {
                    <li style='position:relative;top:0;' data-filter-class='['" 
.$row["tipo"]. "', '" .$row["etiquetas"]. "']'>
                                <a href='" 
.$row["perfil"]. "'>
                                        <div class='sombra'>
.$row["tipo"]. "</h4>
.$row["direccion"]. "</p>
.$row["moneda"]. " " .$row["precio"]. "</p>
                                    <img src='images/" 
.$row["foto1"]. "'>

Any help is appreciated