hi
i have a table with path of images.i want to display the images in a page in a grid format with 9 images per page. i know how to display in a row format but am not being able to display in a grid format. can some one pls help.
thanks in advance..
suk..
code that i hv written is
PHP Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Brickwork India Graphic Design Portfolio</title>
<link href="assets/brickwork_style.css" rel="stylesheet" type="text/css" />
<link href="assets/default.css" rel="stylesheet" type="text/css" />
<link href="assets/lightbox.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/prototype.js"></script>
<script language="javascript" type="text/javascript" src="js/lightbox.js"></script>
</head>
<body>
<div id="inner-main">
<div id="inner-links">
<div id="home-link"><a href="index.html" class="links-home">HOME</a></div>
<div id="home-links"><a href="web_01.html" class="links-home">WEB DESIGN</a></div>
<div id="home-links"><a href="flash_01.html" class="links-home">FLASH ANIMATION</a></div>
<div id="home-links"><a href="brochure_01.html" class="links-home">BROCHURE DESIGN</a></div>
<div id="home-links"><a href="logo_01.html" class="links-home">LOGO DESIGN</a></div>
<div id="home-links"><a href="video_01.html" class="links-home">VIDEO EDITING</a></div>
<div id="home-links"><a href="3d_01.html" class="links-home">3D ANIMATION</a></div>
</div>
<div id="inner-center">
<div id="inner-content">
<div id="inner-heading"><img src="images/head_web.jpg" alt="Web Deign" width="340" height="113" /></div>
<div id="thump-gyap"></div>
<div id="thump-div" style=" padding-left:50;width:600px; height:630px; overflow:auto;" >
<?php
include("db.php");
if (isset($_GET['pageno'])) {
$pageno = $_GET['pageno'];
} else {
$pageno = 1;
} // if
$query = "SELECT count(*) FROM tbl_web ";
$result = mysql_query($query) or trigger_error("SQL", E_USER_ERROR);
$query_data = mysql_fetch_row($result);
$numrows = $query_data[0];
$rows_per_page = 3;
$lastpage = ceil($numrows/$rows_per_page);
$pageno = (int)$pageno;
if ($pageno < 1) {
$pageno = 1;
} elseif ($pageno > $lastpage) {
$pageno = $lastpage;
} // if
$limit = 'LIMIT ' .($pageno - 1) * $rows_per_page .',' .$rows_per_page;
$valid = false;
$sql="SELECT thumb_path FROM tbl_web $limit";
$query = mysql_query($sql) or die (mysql_error());
$count=mysql_num_rows($query);
if ($count>0)
$valid=true;
if ($valid)
{
echo "<table width='95%' border='0' >
<tr>
</tr>";
while($row = mysql_fetch_object($query))
{
?>
<div style=" padding-left:500;" >
<tr>
<td><img src="<?php echo $row->thumb_path ;?>" /> </td>
</tr>
<tr>
<td><div id="thump-text">Web 001</div></td>
</tr>
</div>
<?php
}
echo "</table>";
}
else
{
echo "<BR><center> NO TESTIMONIALS AVAILABLE.</CENTER> ";
}
?>
</div>
</div>
<div id="right-panel">
<div id="right-heading">Web Design</div>
<div id="right-img"><img src="images/dummy_img_01.jpg" alt="Web Design" /></div>
<div id="right-text">
<p>If you haven’t installed your new software, begin by reading some information on installation and other preliminaries. Before you begin working with your software, take a few moments to read an overview of Adobe Help and of the many resources available to users. You have access to instructional videos, plug-ins, templates, user communities, seminars, tutorials, RSS feeds, and much more.</p>
<p>Before you begin working with your software, take a few moments to read an overview of Adobe Help and of the many resources available to users. </p>
</div>
</div>
<div id="next-div"><?php
//links for any previous pages
if ($pageno == 1) {
echo " <span class='next-div'> first prev</span> ";
} else {
echo " <a href='{$_SERVER['PHP_SELF']}?pageno=1'class='next-div'>first</a> ";
$prevpage = $pageno-1;
echo " <a href='{$_SERVER['PHP_SELF']}?pageno=$prevpage'class='next-div'>prev</a> ";
} // if
//Next we inform the user of his current position in the sequence of available pages.
echo " ( Page $pageno of $lastpage )";
//This code will provide the links for any following pages.
if ($pageno == $lastpage) {
echo "<span class='next-div'> next last</span> ";
} else {
$nextpage = $pageno+1;
echo " <a href='{$_SERVER['PHP_SELF']}?pageno=$nextpage'class='next-div'>next</a> ";
echo " <a href='{$_SERVER['PHP_SELF']}?pageno=$lastpage 'class='next-div'>last</a> ";
} // if ?></div>
</div>
<div id="footer">© BrickworkINDIA 2007. All rights reserved.</div>
</div>
</body>
</html>



Reply With Quote
Bookmarks