-
Notifications
You must be signed in to change notification settings - Fork 0
/
ajax.php
26 lines (20 loc) · 929 Bytes
/
ajax.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
$offset=(int)trim($_POST['offset']);
$link = mysql_connect('localhost', 'root', '');
if(!$link) die('Error: '. mysql_error());
$db = mysql_select_db('prettygallery', $link);
if(!$db) die('Error: '. mysql_error());
$limit=10; // 10 photos per request
$sql = "SELECT * FROM items LIMIT $offset,$limit";
$result=mysql_query($sql);
while($row=mysql_fetch_array($result)){
$itemID=$row['item_id'];
?>
<li>
<div class="eachPhoto">
<a href="images/<?php echo $row['filename']; ?>" rel="prettyPhoto[pp_gal]" forCalling="<?php echo $itemID; ?>" title="<?php echo $row['item_name']; ?>">
<img id="shareIT<?php echo $itemID; ?>" src="images/thumbs/thumb_<?php echo $row['filename']; ?>" width="100" height="100" alt="<?php echo $row['description']; ?> " />
</a>
</div>
</li>
<?php }?>