473,788 Members | 2,706 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

paging problem

2 New Member
hi below is my code.
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  include("Globals.php"); 
  3. $connection = mysql_connect("localhost","root","drmz");
  4. mysql_select_db("drmzmove");
  5.  
  6. $Room = mysql_query("select id, ordre, name, e_name, f_name, p_name, color from Rooms where id ='" . get_id("id")."'");
  7. $Room = mysql_fetch_assoc($Room);
  8.  
  9. $room1=$_REQUEST['id'];
  10. $query=mysql_query("select name from rooms where id=$room1");
  11. while($row=mysql_fetch_array($query,MYSQL_ASSOC))
  12. {
  13. $array=$row['name'];
  14. }
  15. ?>
  16. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  17. <html xmlns="http://www.w3.org/1999/xhtml">
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  20. <title>My Photo Gallery</title>
  21. <link href="dreamzproperties.css" rel="stylesheet" type="text/css" />
  22.  
  23.  
  24. </head>
  25. <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
  26. <table border="0" cellpadding="0" cellspacing="0">
  27.   <tr>
  28.     <td colspan="3"><?php include("header.php"); ?></td>
  29.   </tr>
  30.  
  31.   <tr valign="top">
  32.     <td width="1" align="center"><?php include("lf.php"); ?></td>
  33.     <td width="699">
  34.  
  35.     <!-- body start -->
  36.  
  37.     <table width="100%" height="920" border="0" cellpadding="0" cellspacing="0" class="middle_border">
  38.       <tr>
  39.         <td align="center" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  40.           <tr>
  41.             <td align="center" valign="middle"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  42.                 <tr>
  43.                   <td align="center" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  44.                       <tr>
  45.                         <td align="left" valign="middle" bgcolor="#666666" class="heading1"><table width="100" height="20" border="0" cellpadding="0" cellspacing="0">
  46.                             <tr>
  47.                               <td width="15" bgcolor="#FF9900">&nbsp;</td>
  48.                               <td width="85" align="center" valign="middle"><?php echo $array;?></td>
  49.                             </tr>
  50.                         </table></td>
  51.                       </tr>
  52.                     </table>
  53.                       <table width="100%" border="0" cellspacing="2" cellpadding="2">
  54.                         <tr>
  55.                           <td align="center" valign="top">
  56. <?
  57. $Pictures = mysql_query("select id, name from Pictures where Room_id ='" . $HTTP_GET_VARS["id"] . "' order by ordre");
  58.  
  59. $NextRoom = mysql_query("select id from Rooms where id!='" . $HTTP_GET_VARS["id"] .
  60.                         "' and ordre >='" . $Room["ordre"] . "' order by ordre limit 1");
  61.  
  62. if(!($NextRoom = mysql_fetch_assoc($NextRoom)))
  63.   {
  64.   $NextRoom = mysql_query("select id from Rooms order by ordre limit 1");
  65.  
  66.   $NextRoom = mysql_fetch_assoc($NextRoom);
  67.   }
  68.  
  69. $PreviousRoom = mysql_query("select id from Rooms where id!='" . $HTTP_GET_VARS["id"] .
  70.                             "' and ordre <='" . $Room["ordre"] . "' order by ordre desc limit 1");
  71.  
  72. if(!($PreviousRoom = mysql_fetch_assoc($PreviousRoom)))
  73.   {
  74.   $PreviousRoom = mysql_query("select id from Rooms order by ordre desc limit 1");
  75.  
  76.   $PreviousRoom = mysql_fetch_assoc($PreviousRoom);
  77.   }
  78. ?>
  79.                               <table align="center" cellspacing ="3" cellpadding="3">
  80.                                 <?
  81. $NumberOfColumns = 4;
  82. ?>
  83.                                 <tr>
  84.                                   <td align="center" colspan="<?= $NumberOfColumns ?>"><table width="100%">
  85.                                       <tr>
  86.                                         <td align="left" width="33%"><a href="gallery_room.php?id=<?= $PreviousRoom["id"] ?>">Previous</a></td>
  87.                                         <td align="center" width="33%"><a href="gallery.php">Photogallery Index</a></td>
  88.                                         <td align="right"><a href="gallery_room.php?id=<?= $NextRoom["id"] ?>">Next</a></td>
  89.                                       </tr>
  90.                                   </table></td>
  91.                                 </tr>
  92.                                 <tr>
  93.                                   <?
  94. $Column = 0;
  95. while($Picture = mysql_fetch_assoc($Pictures)) {
  96. ?>
  97.                                   <td bgcolor="<?= $Room["color"]; ?>" valign="top"><table width="100" border="0" align="left" cellpadding="0" cellspacing="0" class="img_border">
  98.                                     <tr>
  99.                                       <td align="left" valign="top"><a href="gallery_picture.php?id=<?= $Picture["id"]; ?>" target="_blank"><img src="<?= $Room["name"] ?>_<?= $Room["id"] ?>/ThumbNails/<?= $Picture["name"] ?>_<?= $Picture["id"] ?>.jpg"
  100.      width="130" height="100" hspace="4" vspace="4" border="1" class="middleborder" /></a></td>
  101.                                     </tr>
  102.                                   </table>                                    <a href="gallery_picture.php?id=<?= $Picture["id"]; ?>" target="_blank"></a></td>
  103.                                   <?
  104. $Column++;
  105. if($Column % $NumberOfColumns == 0) {
  106. ?>
  107.                                 </tr>
  108.                                 <tr>
  109.                                   <?
  110. }
  111. }
  112. ?>
  113.                                 </tr>
  114.                               </table>
  115.                             <?
  116. mysql_free_result($Pictures);
  117. mysql_close($connection)
  118. ?>                          </td>
  119.                         </tr>
  120.                     </table></td>
  121.                 </tr>
  122.             </table></td>
  123.           </tr>
  124.         </table></td>
  125.       </tr>
  126.     </table>
  127.  
  128.     <!-- end of body -->    </td>
  129.     <td width="2"><?php include("rf.php"); ?></td>
  130.   </tr>
  131.  
  132.  
  133.   <tr>
  134.     <td colspan="3"><?php include("footer.php"); ?></td>
  135.   </tr>
  136. </table>
  137. </body>
  138. </html>
  139. <?php //require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
how to put paging to this page.
thanks,
keerthi.
Nov 14 '07 #1
4 1436
MarkoKlacar
296 Recognized Expert Contributor
Hi,

could you please re-post the code using the code tags...

Thanks
Nov 14 '07 #2
post
17 New Member
[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'];
?>
[/PHP]
[HTML]
<!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">&nbsp;</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">
[/html]
[php]
<?
$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 = 3;
?>
<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="2" cellspacing="2" 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>
<td>&nbsp;</td>
<?
$Column++;
if($Column % $NumberOfColumn s == 0) {
?>
</tr>
<tr>
<td>&nbsp;</td>
</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'); ?>
[/PHP]

Next time use the [php] tag. :D
Nov 14 '07 #3
keerthitest
2 New Member
hi no body there to solve my problem? atleast can any one send the paging code.
thanks,
keerthi
Nov 16 '07 #4
code green
1,726 Recognized Expert Top Contributor
hi no body there to solve my problem? atleast can any one send the paging code
What is the problem?
Where is the problem occuring?
Nov 16 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2150
by: Li | last post by:
Hi, guys, I got a problem when trying to paging the recordset. the problem is even I set the pagesize but the first page will always show all the records and the number of records that shown on the second page will always all records number minus pagesize. for example, if I have total 5 records and pagesize = 2, then first page will show 5 record and second one will show 3 and the last page will show the last one. any one have some...
3
1621
by: sara | last post by:
Hi all, I have a strange problem. I have a page where I am creating a recordset that can handle paging and the query for it was originally selecting from only one table. This was all working nicely, including the paging. I have now changed the query to select from two joined tables and suddenly it tells me that my recordset does not support paging. Why is this? Any help would be much appreciated,
2
1756
by: Daniel Walzenbach | last post by:
Hi, I have a question regarding the DataGrid control. If paging is enabled the grid binds the data, sets the paging on the top/bottom (or however it is set up) and throws away unnecessary data. So far so good for a tiny amount of data but if some 100000 of rows are the source this approach is stupid.
2
3150
by: saleek | last post by:
Hi, I am trying to figure out why my datagrid has stopped firing the page and sort commands. Scenario: I originally had template columns in my datagrid and had set up custom bi-directional sorting as well as paging of the datagrid records.
2
6455
by: farhad13841384 | last post by:
Hi , I Hope You fine. I have some problem with this code for paging in asp.net this bottom code work correctly without any error but when I try to place separate code in .VB file then error is begin and occured .I want to separate this code and compiling .vb code using VBC.exe later .(bin/paging.dll) when do it like me so you retrive only < Previous Page Next Page > in your web browser and you don't retrive list Of data in your web browser....
2
13201
by: antonyliu2002 | last post by:
I've been googling for some time, and could not find the solution to this problem. I am testing the paging feature of gridview. I have a very simple web form on which the user can select a few fields to be included in the table, which is to be bound to the gridview. The web form looks like so (Don't worry about the stupidity of this web form for now.):
2
1940
by: rn5a | last post by:
In a shopping cart app, a ASPX page retrieves the order details & personal details of a user from a MS-Access database table depending upon the username of the user. The order details of a particular order (like ProductID, Name, Description, Quantity etc.) are displayed in one DataGrid where as the personal details of the buyer corresponding to this order (like Name, E-Mail, Shipping & Billing Address etc.) are displayed in another...
7
2331
by: =?Utf-8?B?SmVmZiBCZWVt?= | last post by:
The default paging behavior of the gridview doesn't work well with very large sets of data which means we have to implement some sort of custom paging. The examples I have seen (4guysfromrolla, etc.) suggest using an ObjectDataSource which has built-in paging functionality that, when used in conjunction with certain SQL 2005 functionality, only works with the records to be displayed on the page rather than the entire set. The problem with...
1
2614
by: =?Utf-8?B?TG95b2xhIHN0YWxpbg==?= | last post by:
Hi, I am using ASP.Net 2.0 version and Windows'XP OS. I am useing the Grid view control to display the user details along with the paging concept provided by the grid view control. When i click the paging link (2,3,4.. ) it produces the result properly, But my problem is when i tried to press the Refresh button in the explorer, it throws the following popup alert message
2
5516
by: wallconor | last post by:
Hi, I am having a problem using Dreamweaver CS3 standard recordset paging behavior. It doesn’t seem to work when I pass parameter values from a FORM on my search page, to the recordset on my results page. - Recordset Paging works if no parameters are used in the recordset sql code (ie. simple sql code): SELECT * FROM db_name WHERE (db_field1 LIKE ‘%text1%’ OR db_field2 LIKE ‘%text2%’)
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10177
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5402
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4074
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2896
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.