Witam
Mam taki kod:
<?php
$row = $db->query_first("SELECT COUNT(*) AS itemCount FROM items WHERE isWaiting = '0'");
if (!isset($_GET["page"])) $_GET["page"] = 0;
$paginator = getPaginator($row["itemCount"],$_GET["page"],"glowna");
$showPerPage = (int)SHOW_PER_PAGE;
$showMe = $_GET["page"]*$showPerPage;
$randAdPlace = rand(2
,$showPerPage);
$items = $db->query("SELECT *,ite.id,ite.addTime AS addTime, COUNT(comm.cid) AS commNo FROM items AS ite LEFT OUTER JOIN comments AS comm ON comm.picId=ite.id LEFT JOIN users ON (users.uid=ite.uId) WHERE ite.isWaiting = '0' GROUP BY ite.id ORDER BY ite.addTime DESC LIMIT " . $showMe . ", " . $showPerPage);
$i = 0;
while ($row = $db->fetch_array($items)) {
$i++;
$addClass = ($i < $showPerPage) ? ' morespace' : '';
if ($i == $randAdPlace) {
?>
<div class="contener3">
<div class="advertItems">
<?php
echo getGoogleAd
('pub-xxxxxxxxxxxxxx','xxxxxxxxxxxx',336,280,'http://strona.pl/rek/kwadrat.html'); ?>
</div>
</div><br>
<?php
}
$preLink = '';
echo '<div class="contener">'; require("includes/item.inc.php");
}
if($i == 0) {
} else {
?>
<div class="contener2">
<div class="paginator">
<?php
echo getGoogleAd
('pub-xxxxxxxxxxxxxxx','xxxxxxxxxx',728,90,'http://strona.pl/rek/jd.html'); ?>
</div>
</div>
<?php
}
?>
i mam pytanie czy te zapytania mysql powinny być jakoś kończone/zamykane - $db->close()?
Ten post edytował marcin0077 15.07.2011, 13:27:26