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 ?


HERE IS THE CODE

HTML Code:

<form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method='POST'>
	<p>Tipo</p>
	<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>
	<p>Ciudad</p>
	<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>
	<p>Precios</p>	
	<select name="opt3">
		<option selected>all</option>
		<option value="terrenas">terrenas</option>
		<option value="bavaro">bavaro</option>
		<option value="naco">naco</option>
	</select>
	<input type='submit'>
</form>

PHP Code:

<?php                     
            
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)) {
                echo 
"<ul id='tiles'>";
                while (
$row mysql_fetch_array($result)) {
                echo 
"
                    <li style='position:relative;top:0;' data-filter-class='['" 
.$row["tipo"]. "', '" .$row["etiquetas"]. "']'>
                                <a href='" 
.$row["perfil"]. "'>
                                    <div>
                                        <div class='sombra'>
                                            <h4>" 
.$row["tipo"]. "</h4>
                                            <p>" 
.$row["direccion"]. "</p>
                                            <p>" 
.$row["moneda"]. " " .$row["precio"]. "</p>
                                        </div>    
                                    </div>
                                    <img src='images/" 
.$row["foto1"]. "'>
                                </a>
                            </li>
                "
;
                }
                echo 
"</ul>";
            }
        
?>







Any help is appreciated