hi below is my code.[code=php]
<?php
include("Global s.php");
$connection = mysql_connect(" localhost","roo t","drmz");
mysql_select_db ("drmzmove") ;
$Room = mysql_query("se lect id, ordre, name, e_name, f_name, p_name, color from Rooms where id ='" . get_id("id")."' ");
$Room = mysql_fetch_ass oc($Room);
$room1=$_REQUES T['id'];
$query=mysql_qu ery("select name from rooms where id=$room1");
while($row=mysq l_fetch_array($ query,MYSQL_ASS OC))
{
$array=$row['name'];
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>My Photo Gallery</title>
<link href="dreamzpro perties.css" rel="stylesheet " type="text/css" />
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0 ">
<table border="0" cellpadding="0" cellspacing="0" >
<tr>
<td colspan="3"><?p hp include("header .php"); ?></td>
</tr>
<tr valign="top">
<td width="1" align="center"> <?php include("lf.php "); ?></td>
<td width="699">
<!-- body start -->
<table width="100%" height="920" border="0" cellpadding="0" cellspacing="0" class="middle_b order">
<tr>
<td align="center" valign="top"><t able width="100%" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td align="center" valign="middle" ><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFF F">
<tr>
<td align="center" valign="middle" ><table width="100%" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td align="left" valign="middle" bgcolor="#66666 6" class="heading1 "><table width="100" height="20" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td width="15" bgcolor="#FF990 0"> </td>
<td width="85" align="center" valign="middle" ><?php echo $array;?></td>
</tr>
</table></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="2" cellpadding="2" >
<tr>
<td align="center" valign="top">
<?
$Pictures = mysql_query("se lect id, name from Pictures where Room_id ='" . $HTTP_GET_VARS["id"] . "' order by ordre");
$NextRoom = mysql_query("se lect id from Rooms where id!='" . $HTTP_GET_VARS["id"] .
"' and ordre >='" . $Room["ordre"] . "' order by ordre limit 1");
if(!($NextRoom = mysql_fetch_ass oc($NextRoom)))
{
$NextRoom = mysql_query("se lect id from Rooms order by ordre limit 1");
$NextRoom = mysql_fetch_ass oc($NextRoom);
}
$PreviousRoom = mysql_query("se lect id from Rooms where id!='" . $HTTP_GET_VARS["id"] .
"' and ordre <='" . $Room["ordre"] . "' order by ordre desc limit 1");
if(!($PreviousR oom = mysql_fetch_ass oc($PreviousRoo m)))
{
$PreviousRoom = mysql_query("se lect id from Rooms order by ordre desc limit 1");
$PreviousRoom = mysql_fetch_ass oc($PreviousRoo m);
}
?>
<table align="center" cellspacing ="3" cellpadding="3" >
<?
$NumberOfColumn s = 4;
?>
<tr>
<td align="center" colspan="<?= $NumberOfColumn s ?>"><table width="100%">
<tr>
<td align="left" width="33%"><a href="gallery_r oom.php?id=<?= $PreviousRoom["id"] ?>">Previous</a></td>
<td align="center" width="33%"><a href="gallery.p hp">Photogaller y Index</a></td>
<td align="right">< a href="gallery_r oom.php?id=<?= $NextRoom["id"] ?>">Next</a></td>
</tr>
</table></td>
</tr>
<tr>
<?
$Column = 0;
while($Picture = mysql_fetch_ass oc($Pictures)) {
?>
<td bgcolor="<?= $Room["color"]; ?>" valign="top"><t able width="100" border="0" align="left" cellpadding="0" cellspacing="0" class="img_bord er">
<tr>
<td align="left" valign="top"><a href="gallery_p icture.php?id=< ?= $Picture["id"]; ?>" target="_blank" ><img src="<?= $Room["name"] ?>_<?= $Room["id"] ?>/ThumbNails/<?= $Picture["name"] ?>_<?= $Picture["id"] ?>.jpg"
width="130" height="100" hspace="4" vspace="4" border="1" class="middlebo rder" /></a></td>
</tr>
</table> <a href="gallery_p icture.php?id=< ?= $Picture["id"]; ?>" target="_blank" ></a></td>
<?
$Column++;
if($Column % $NumberOfColumn s == 0) {
?>
</tr>
<tr>
<?
}
}
?>
</tr>
</table>
<?
mysql_free_resu lt($Pictures);
mysql_close($co nnection)
?> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<!-- end of body --> </td>
<td width="2"><?php include("rf.php "); ?></td>
</tr>
<tr>
<td colspan="3"><?p hp include("footer .php"); ?></td>
</tr>
</table>
</body>
</html>
<?php //require(DIR_WS_ INCLUDES . 'application_bo ttom.php'); ?>[/code]
how to put paging to this page.
thanks,
keerthi.
<?php
include("Global s.php");
$connection = mysql_connect(" localhost","roo t","drmz");
mysql_select_db ("drmzmove") ;
$Room = mysql_query("se lect id, ordre, name, e_name, f_name, p_name, color from Rooms where id ='" . get_id("id")."' ");
$Room = mysql_fetch_ass oc($Room);
$room1=$_REQUES T['id'];
$query=mysql_qu ery("select name from rooms where id=$room1");
while($row=mysq l_fetch_array($ query,MYSQL_ASS OC))
{
$array=$row['name'];
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>My Photo Gallery</title>
<link href="dreamzpro perties.css" rel="stylesheet " type="text/css" />
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0 ">
<table border="0" cellpadding="0" cellspacing="0" >
<tr>
<td colspan="3"><?p hp include("header .php"); ?></td>
</tr>
<tr valign="top">
<td width="1" align="center"> <?php include("lf.php "); ?></td>
<td width="699">
<!-- body start -->
<table width="100%" height="920" border="0" cellpadding="0" cellspacing="0" class="middle_b order">
<tr>
<td align="center" valign="top"><t able width="100%" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td align="center" valign="middle" ><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFF F">
<tr>
<td align="center" valign="middle" ><table width="100%" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td align="left" valign="middle" bgcolor="#66666 6" class="heading1 "><table width="100" height="20" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td width="15" bgcolor="#FF990 0"> </td>
<td width="85" align="center" valign="middle" ><?php echo $array;?></td>
</tr>
</table></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="2" cellpadding="2" >
<tr>
<td align="center" valign="top">
<?
$Pictures = mysql_query("se lect id, name from Pictures where Room_id ='" . $HTTP_GET_VARS["id"] . "' order by ordre");
$NextRoom = mysql_query("se lect id from Rooms where id!='" . $HTTP_GET_VARS["id"] .
"' and ordre >='" . $Room["ordre"] . "' order by ordre limit 1");
if(!($NextRoom = mysql_fetch_ass oc($NextRoom)))
{
$NextRoom = mysql_query("se lect id from Rooms order by ordre limit 1");
$NextRoom = mysql_fetch_ass oc($NextRoom);
}
$PreviousRoom = mysql_query("se lect id from Rooms where id!='" . $HTTP_GET_VARS["id"] .
"' and ordre <='" . $Room["ordre"] . "' order by ordre desc limit 1");
if(!($PreviousR oom = mysql_fetch_ass oc($PreviousRoo m)))
{
$PreviousRoom = mysql_query("se lect id from Rooms order by ordre desc limit 1");
$PreviousRoom = mysql_fetch_ass oc($PreviousRoo m);
}
?>
<table align="center" cellspacing ="3" cellpadding="3" >
<?
$NumberOfColumn s = 4;
?>
<tr>
<td align="center" colspan="<?= $NumberOfColumn s ?>"><table width="100%">
<tr>
<td align="left" width="33%"><a href="gallery_r oom.php?id=<?= $PreviousRoom["id"] ?>">Previous</a></td>
<td align="center" width="33%"><a href="gallery.p hp">Photogaller y Index</a></td>
<td align="right">< a href="gallery_r oom.php?id=<?= $NextRoom["id"] ?>">Next</a></td>
</tr>
</table></td>
</tr>
<tr>
<?
$Column = 0;
while($Picture = mysql_fetch_ass oc($Pictures)) {
?>
<td bgcolor="<?= $Room["color"]; ?>" valign="top"><t able width="100" border="0" align="left" cellpadding="0" cellspacing="0" class="img_bord er">
<tr>
<td align="left" valign="top"><a href="gallery_p icture.php?id=< ?= $Picture["id"]; ?>" target="_blank" ><img src="<?= $Room["name"] ?>_<?= $Room["id"] ?>/ThumbNails/<?= $Picture["name"] ?>_<?= $Picture["id"] ?>.jpg"
width="130" height="100" hspace="4" vspace="4" border="1" class="middlebo rder" /></a></td>
</tr>
</table> <a href="gallery_p icture.php?id=< ?= $Picture["id"]; ?>" target="_blank" ></a></td>
<?
$Column++;
if($Column % $NumberOfColumn s == 0) {
?>
</tr>
<tr>
<?
}
}
?>
</tr>
</table>
<?
mysql_free_resu lt($Pictures);
mysql_close($co nnection)
?> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<!-- end of body --> </td>
<td width="2"><?php include("rf.php "); ?></td>
</tr>
<tr>
<td colspan="3"><?p hp include("footer .php"); ?></td>
</tr>
</table>
</body>
</html>
<?php //require(DIR_WS_ INCLUDES . 'application_bo ttom.php'); ?>[/code]
how to put paging to this page.
thanks,
keerthi.
Comment