Hello, I need to add pages to my site. specifically it is a preview of a report of 3000 records and I want to show on each page 100 This is my query:
$sql ="SELECT documento.* FROM documento
LEFT JOIN ubicacion ON (ubicacion.documento_id = documento.documento_id)
WHERE unidad_id IN(
SELECT u.unidad_id FROM unidad AS u,estructura AS e
WHERE u.estructura_id = e.estructura_id
AND e.padre_estructura_id =3)
AND estado_documento_id NOT LIKE '7'
GROUP BY documento_id limit 0,100"
and to do the total count of the documents I have this:
$cnt = mysql_num_rows(mysql_query($sql));
but when I look at the site, only 100 records appear and I can not change the page, only 1 of 1 appears when it should be around 3O pages.
this is the method:
$cntp = ($cnt % $ipp > 0)+(int)($cnt / $ipp);
print "<div align=center>" . $lan["page"] . " <select onchange='submit();' name=showfrom>";
for ($i=0;$i<$cnt;$i+=$ipp)
{
$pn = 1+(int)($i/$ipp);
print "<option value=$i ".($_POST['showfrom'] == $i ? "selected" : "").">$pn</option>";
}
print "</select> " . $lan["of"] . " $cntp</div></form>";