Witam, trochę czasu spędziłem na stronicowaniu skryptu licznik kliknięć , a mianowicie licznik ten wyświetla miniaturki zdjęć jest ich dość dużo sam skrypt wygląda tak plik index
include("conn.php");
$sql = mysqli_query($link, "SELECT id,image,post_date,title,duration,download FROM wp_my_plugin GROUP BY post_date DESC ");
while($result = mysqli_fetch_object($sql)):
?>
<a border="0" href="counter.php?id=
<?php echo $result->id; ?>" class="gals-box MultimediaItem MMID_216667" ">
<img border="0" src="
<?php echo $result->image; ?>"width="90" height="56" ><strong>
<?php echo $result->title; ?> </strong><em>
<?php echo $result->duration; ?></em>
</a>
<?php
drugi plik counter.php
//1. include the configuration file
include("conn.php");
//2. Get the id from the url and store it into a variable
$id = mysqli_real_escape_string($link, $_GET['id']);
//3. fetch the url and clicks from this banner
$clicks = mysqli_fetch_object(mysqli_query($link, "SELECT image,hd,download FROM wp_my_plugin WHERE id=".$id.""));
//4. increase clicks with 1
$new_click = $clicks->download+1;
//5. update this into the database, check if it was succesfull
if(mysqli_query($link, "UPDATE wp_my_plugin SET up_post_date=NOW(),download=".$new_click." WHERE id=".$id."")):
//6. redirect to the url
header("Location: ".$clicks->hd); else:
//6. else write to error log
endif;
i nie mam pojęcia jak zrobić do tego stronicowanie .
Ten post edytował slawekxx 24.07.2011, 12:16:08