If you can help me how you could enter a counter in the while, the idea is to filter it by a range of dates shows me the information otherwise if it is out do not show me if you can help me thank you .
here is the code
<?php
require_once('../conexion/conexion.php');
// echo "hola";
$id_convenios =$_POST['id_convenios'];
$bus =$_POST['bus'];
$fechai =$_POST['fechai'];
$fechaf =$_POST['fechaf'];
$sql = "SELECT ca.id_campanas,
ca.nombre,
esc.nombre estado_campanas,
co.nombre convenios,
ca.presupuesto,
ca. fc
FROM campanas ca
INNER JOIN estado_campanas esc ON esc.id_estadoc = ca.id_estadoc
INNER JOIN convenios co ON co.id_convenios = ca.id_convenios
WHERE ca.nombre like '%$bus%'
AND ca.id_convenios = '$id_convenios'
AND ca.estado = 'Activo'
AND date('fecha_i') BETWEEN date('$fechai') AND date('$fechaf')
";
echo "</br>";
echo $sql;
$result = mysqli_query($link, $sql);
echo "</br>";
echo '<table class="table table-hover">
<a class="align-middle">
<thead>
<tr style="background:#e1e2e6;">
<th style="color: #1674ae;text-align: center;">Nombre de la Campaña</th>
<th style="color: #1674ae;text-align: center;">Nombre Estado de la Campaña</th>
<th style="color: #1674ae;text-align: center;">Nombre del Convenio</th>
<th style="color: #1674ae;text-align: center;">Presupuesto</th>
<th style="color: #1674ae;text-align: center;">Fecha de Creación</th>
</tr>
</thead>';
$filas=0;
while ($filas = mysqli_fetch_array($result))
{
if($filas<0){
echo "<tr>
<td style='text-align: center'>$filas[nombre] </td>
<td style='text-align: center'>$filas[estado_campanas]</td>
<td style='text-align: center'>$filas[convenios]</td>
<td style='text-align: center'>$filas[presupuesto]</td>
<td style='text-align: center'>$filas[fc]</td>
</tr>";
$filas++;
}
else {
echo "no se encontraron resultados";
}
}
echo "</table> <br> </div>";
?>