Just place it before your while() loop: [code]<?php include 'library/config.php'; include 'library/opendb.php'; $id = $_GET['id']; if ($id == "") { $rowsPerPage = 6; $pageNum = 1; if(isset($_GET['page'])) { $pageNum = $_GET['page']; } $offset = ($pageNum - 1) * $rowsPerPage; $query = "SELECT id, name, path, title, thumbnail, playcount, DATE_FORMAT(entry_date, '%M %D %Y') FROM upload2 ORDER BY id DESC LIMIT $offset, $rowsPerPage"; $result = mysql_query($query) or die('Error, query failed'); ?> <div class="title">Videos</div> <?php while($row = mysql_fetch_array($result)) { ?> /*Your Other HTML Markup for your loop*/ /*Then close your loop*/ <?php } ?> [/code]