Put pagination recordset inside a function

Hi, I need some help if its possible.
I'm using Dreamweaver's PHP code for selecting data from database and outputing them in pages ( Pagination ). I thought to create a very general record set and then put it in a function so I can re-use it,  and change only things like the query and the $maxRows_. So it looks like this:
.....                                                                                                           ..... PreviousNext.....
How can I make this??? Imean if I put all the php code (above the html tags) inside a function, what should my function return back, how will the output data inside the while loop will appear properly and also the pagin links???

There are many scripts that are pre-made, tried & tested that you could use.
There's a beautiful step-by-step tutorial along with source files here that you can easily follow: http://net.tutsplus.com/tutorials/php/how-to-paginate-data-with-php/
-ST

Similar Messages

  • Movieclip(root) doesn't work inside a function

    Hey everyone,
    I'm having this problem.
    In fact, when i publish my FLA with player 9, there is no prob.
    When i publish with selecting player 10, there is this problem.
    I paste my code :
    var leng:int = MovieClip(root).program.websiteXML.pages.titlePage.length();
    trace ("leng"+leng);
    setInterval(function () : void {
              if (MovieClip(root).program.autoCh==true){
               trace("CHANGE");
              MovieClip(root).allContent.controllMenu2['itemButton_' + MovieClip(root).program.linkPic].gotoAndPlay("s4");
              if (MovieClip(root).program.linkPic < int(leng-1)){
                        MovieClip(root).program.linkPic++;
                           }else{
                               //MovieClip(root).allContent.play ();
                             MovieClip(root).program.autoCh=false;
                             MovieClip(root).program.linkPic=1;
                             MovieClip(root).allContent.controllMenu2['itemButton_' + MovieClip(root).program.linkPic].gotoAndPlay("s4");
                             for (var z:uint=1; z<(MovieClip(root).program.linkPic+1); z++) {
                                  var tempMC:MovieClip = MovieClip(MovieClip(root).allContent.controllMenu2)["itemButton_"+z];
                                  Tweener.addTween(tempMC, { x:(z-1)*(45+1)-353, time:1} );     
                             for (var j:uint=(MovieClip(root).program.linkPic+1); j<7; j++) {
                                  var tempMC2:MovieClip = MovieClip(MovieClip(root).allContent.controllMenu2)["itemButton_"+j];
                                  Tweener.addTween(tempMC2, { x:(j-1)*(45+1)+352, time:1} );     
                             MovieClip(root).allContent.controllMenu2['itemButton_' + MovieClip(root).program.linkPic].gotoAndPlay("s3");
                       }}, 4000);
    For leng variable, there is no problem, the value is taken.
    But it's inside SetIntervall, at
    MovieClip(root).program.autoCh
    it tells me that :
    TypeError: Error #1009: Il est impossible d'accéder à la propriété ou à la méthode d'une référence d'objet nul.
        at Function/<anonymous>()[main6_cs3_fla._00button_136::frame1:32]
        at Function/http://adobe.com/AS3/2006/builtin::apply()
        at SetIntervalTimer/onTimer()
        at flash.utils::Timer/_timerDispatch()
        at flash.utils::Timer/tick()
    And if I put the value outside the function :
    var autoChtest = MovieClip(root).program.autoCh;
    And use it :
    if (autoChtest==true)
    There is no errors but my function doesn't work correctly, as autoCh can be "false" in another action.
    Well, I hope this will not scare you, and someone will try to help me, please.
    If someone know anything about this issue or having same problem please tell me.
    Thanks!

    Ok i see more clearly, you know it's diificult for me to understand it because i'm into flash AS since a few weeks.
    And what you say about the way setInterval is use, with the function in it, i'm totally agree with that, it's difficult to read.
    The truth is that this is a template that I bought and it was like that, so to do what i've got to do i needed to change some AS3 code.
    This is how it is now :
    var rootvar = MovieClip(root).root;
    function diapodebut (e:TimerEvent) : void {
        if (rootvar.program.autoCh==true){
            trace("CHANGE");       
            rootvar.allContent.controllMenu2['itemButton_' + rootvar.program.linkPic].gotoAndPlay("s4");
            if (rootvar.program.linkPic < int(leng-1)){
                rootvar.program.linkPic++;
            }else{
                  //MovieClip(root).allContent.play ();
                rootvar.program.autoCh=false;
                rootvar.program.linkPic=1;
            rootvar.allContent.controllMenu2['itemButton_' + rootvar.program.linkPic].gotoAndPlay("s4");
            for (var $z:uint=1; $z<(rootvar.program.linkPic+1); $z++) {
                var tempMC:MovieClip = MovieClip(rootvar.allContent.controllMenu2)["itemButton_"+$z];
                Tweener.addTween(tempMC, { x:($z-1)*(45+1)-353, time:1} );   
            for (var j:uint=(rootvar.program.linkPic+1); j<7; j++) {
                var tempMC2:MovieClip = MovieClip(rootvar.allContent.controllMenu2)["itemButton_"+j];
                Tweener.addTween(tempMC2, { x:(j-1)*(45+1)+352, time:1} );   
            rootvar.allContent.controllMenu2['itemButton_' + rootvar.program.linkPic].gotoAndPlay("s3");
        else
            timerSynchro.stop( );
    var leng:int = MovieClip(root).program.websiteXML.pages.titlePage.length();
    trace ("leng"+leng);
    var timerSynchro:Timer = new Timer( 4000, 6) ;
    timerSynchro.addEventListener( TimerEvent.TIMER, diapodebut);
    timerSynchro.start() ;
    You can see that I use Timer class, i've seen on another website just what you say : use Timer instead of setInterval with AS3.
    If you still find something wrong to you, tell me!
    Thanks again for your help !

  • How to create a secondary list of alv grid inside the function module

    Hi All,
    My requirement is to create a RFC function module to display the alv grid of one table.
    i have created that.
    while clicking on the records of the alv it should open the secondary list of another table.
    My problem is it is not fetching the records of the internal table of the primary list since it is created inside the function module(FUNCTION...ENDFUNCTION).
    pls help me on this.
    Thanks in Advance.

    hi,
    READ TABLE sel_sheet INTO wa_sheet INDEX rs_selfield-tabindex.
    here sel_sheet is the internal table for the primary list..
    i called the function module "reuse_lav_grid_display" inside Function...Endfunction.
    so when i am using  READ TABLE sel_sheet INTO wa_sheet INDEX rs_selfield-tabindex.
    inside the user command perform therecords in this internal table is not populating..
    pls help me on this.
    thanks in advance.

  • Renaming a file inside a function in PL/SQL

    Hi,
    I have a file called TMP_g2_response_data. I have some data in it. I read the data inside my function. Once I read the data, I want to move it to some another file. Basically I want to rename the file TMP_g2_response_data to TMP_g2_response_data.old. How can I do this from my PL/SQL code.
    Please help me out.
    Thanks in andvance

    Its appropriate.
    I just coded it this way. Have a look at it. Please tell me where I am going wrong.
    create or replace procedure fmov as
    log varchar2(300);
    logfile UTL_FILE.FILE_TYPE;
    newlog varchar2(300);
    cmd varchar2(300);
    begin
    log := 'test-log';
    logfile := utl_file.fopen('/tmp', log, 'W');
    utl_file.put_line(logfile,'Here we go');
    utl_file.frename('/tmp',logfile,'/tmp','test-log.old');
    utl_file.fclose(logfile);
    end;
    show errors;
    Thanks in advance

  • How to get al object's type used inside a function group

    Hello There,
    I want to create a program to get all the objects used inside a Function group, for example all the data structure type (not the field name of fieds ortable name used in import/export but their data types) used in import/export/table parameters of Function group or Function module inside that FG. I also want to know all the field types/function module/class/method etc used inside a FG.
    The main purpose is to create a program to know if a function group uses a object from a particular software component. we have a requirement in our project for example all the standard objects used in a program should belong to only sap_basis /sap_abap/sap_appl software component.
    I realy appreciate any help on the same.
    Mani

    Goto se80, provide the function group, double click on the object name, click on the main program button and get the function pool name. Now place this function pool name in se38 , go to menu utilities->environment analysis. You will get the list. If you would like to do this via custom program then see through debugging mode and check what is coded.
    Kesav

  • Can we add the standard includes inside a function exit.

    Hi,
    Can we add the standard includes inside a function exit.
    I want to add 4 to 5 standard includes. If iam adding it it says report or program already exists.
    Can anyone tell me is it possible or we can modify the only the data which is coming to that function module .
    Please help me on this.
    Thanks,
    Rose.

    hi santhosh,
      The data needed for those includes are also exist in the funtion module exit. I want to add those includes and in one include just i want to add some 10 to 15 lines of code. Is it possible.
    If i include all those includes inside the function exit it says report or program name already exists. When i double clicked on the error it takes me to a line in 1 include which has function-pool statement.
    How can i eradicate this error.
    Can u please help me on this.

  • Using SET DATEFIRST inside a function to call into a view

    Hi,
    I need to use the statement SET DATEFIRST inside a function. This operation is not available, but I need to use this command into a function to call inside a view.
    How can I solve this issue?
    Thanks

    Eventually you will learn 2 very important things.  First, the term "working day" has no absolute definition and varies by country, organization, culture, etc.  Second is that circumstances will occur that change what should be considered a working
    day to a non-working day (or vice versa).  While you might attempt to create logic that "forecasts" whether a given date in the future is a working day, you cannot apply that logic to past dates.  The best solution is to create a calendar table for
    this purpose - some forum/internet searching will find many different variations.

  • How to put a table inside a frame in html

    Hi, I have a html table as follows:
    <TABLE BORDER=2><TR><TD>No</TD><TD>Name</TD><TD>Age</TD></TR><TR><TD>1</TD><TD>John</TD><TD>30</TD></TR><TR><TD>2</TD><TD>Michael</TD><TD>20</TD></TR></TABLE>
    I want to put it inside a html frame in order to have the scroll bar with the table.
    Is there a way to do it in html?
    Thanks.

    Put the table inside of a div tag with a set width and height, borders, and overflow set to scroll:
    <html>
      <head>
        <style>
          .tableDiv {
         width: 140px;
            height: 200px;
            overflow: scroll;
            border: 3px outset;
          .no {
            width: 20px;
          .name {
            width: 50px;
          .age {
            width: 30px;
        </style>
      </head>
      <body>
        <div class="tableDiv">
        <table border="2">
        <thead>
          <TR><TH class="no">No</TH><TH class="name">Name</TH><TH class="age">Age</TH></TR>
        </thead>
        <tbody>
          <TR><TD class="no">1</TD><TD class="name">John</TD><TD class="age">30</TD></TR>
          <TR><TD class="no">1</TD><TD class="name">John</TD><TD class="age">30</TD></TR>
          <TR><TD class="no">1</TD><TD class="name">John</TD><TD class="age">30</TD></TR>
          <TR><TD class="no">1</TD><TD class="name">John</TD><TD class="age">30</TD></TR>
          <TR><TD class="no">1</TD><TD class="name">John</TD><TD class="age">30</TD></TR>
          <TR><TD class="no">1</TD><TD class="name">John</TD><TD class="age">30</TD></TR>
          <TR><TD class="no">1</TD><TD class="name">John</TD><TD class="age">30</TD></TR>
          <TR><TD class="no">1</TD><TD class="name">John</TD><TD class="age">30</TD></TR>
          <TR><TD class="no">1</TD><TD class="name">John</TD><TD class="age">30</TD></TR>
          <TR><TD class="no">1</TD><TD class="name">John</TD><TD class="age">30</TD></TR>
          <TR><TD class="no">1</TD><TD class="name">John</TD><TD class="age">30</TD></TR>
          <TR><TD class="no">1</TD><TD class="name">John</TD><TD class="age">30</TD></TR>
          <TR><TD class="no">1</TD><TD class="name">John</TD><TD class="age">30</TD></TR>
        </tbody>
        </table>
        </div>
      </body>
    </html>

  • How to put in process chain a function to desactivate aggregates

    Hi all, how can i do  to put in process chain a function to desactivate aggregates
    thanks

    Hello Jorge,
    You can use a ABAP process type and call the program
    SAP_AGGREGATES_DEACTIVATE to deactivate the aggregates.
    Similarly if you want to fill through an ABAP program you can use
    SAP_AGGREGATES_ACTIVATE_FILL
    You can refer this doc
    [Aggregates - Initial Fill: Custom Approach to Fill in Parallel|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7005b9ff-6871-2910-009e-f4d214cbe81f]
    You can also refer this Wiki
    [Useful ABAP Programs & Function Modules in SAP BI - Business Intelligence|https://www.sdn.sap.com/irj/sdn/wiki?path=/pages/viewpage.action?pageId=35458]
    Thanks
    Chandran

  • How to put Form tag inside PlaceHolderUtilityContent

    I created a page layout (using design manager), and my design has <form> tags in it
    <form>
    <!-- code -->
    </form>
    and Ive read that HTML file cannot contain <form> tags here -
    http://msdn.microsoft.com/en-us/library/office/jj822362(v=office.15).aspx
    It says that I should put the form inside the PlaceholderUtitlityContent placeholder
    <!--CS: Start Create Snippets From Custom ASP.NET Markup Snippet-->
    <!--SPM:<SharePoint:AjaxDelta id="DeltaPlaceHolderUtilityContent" runat="server">-->
    <!--SPM:<asp:ContentPlaceHolder id="PlaceHolderUtilityContent" runat="server" />-->
    <!--SPM:</SharePoint:AjaxDelta>-->
    <!--CE: End Create Snippets From Custom ASP.NET Markup Snippet-->
    My question is where do i insert my form block in the snippet above?
    ----------------------- Sharepoint Newbie

    Hi,
    Instead of putting <form> tag in layout page, you can place it in the master page.
    <body scroll="no">
    <form id="Form1" runat="server">
    Here place all the place holders
    </form>
    </body>
    and then refer this master page in Layout .
    Let me know if you have any doubt.
    Thanks
    -Rahul

  • When i put a disc inside my macbook.....

    when i put a disc inside my macbook it goes in the it ejects,
    can someone tell me the problem & help me out?
    im trying to install my printer and mircrosoft word!
    HELP?
    macbook black   Mac OS X (10.4.8)  

    hi troy-
    i'm having the same problem. i've tried dvds with the macbook and they play, but the osx install disc does not. the disc has been stored carefully, looks clean, and is free of burrs and so forth, so not sure what is up. any ideas?
    thanks,
    jesse

  • How do we trap exception inside the function module?

    How do we trap exception inside the function module?

    Use ABAP Help - CATCH, RAISE for starters. Or take a look at an existing function module, for example.

  • How can I put a subpanel inside another subpanel?

    Hi,
    Is it possible to put one subpanel o several subpanels inside one main subpanel?
    Thanks,
    ToNi.

    DFGray wrote:
    You can create something in LabVIEW to do this, but it won't be trivial. Here are some things to point you on your way. I have not done this, so it is pure speculation on how I would go about solving this problem.
    You will need to know ahead of time the maximum number of windows you will want. On your front panel, create that many individual subpanels. You can hide the border and make them transparent so you never see them unless something is in them.
    When you load a VI into the subpanel, all you get is the panel, not the title bar. You will need to create a title bar with buttons and any border you want on the VIs in the panel area. This is tedious, but fairly straightforward, especially if you use system colors to make it look like a real title bar/border. You won't be able to make it look like an XP title bar unless you use bitmaps/picture control. If you go that route, you can probably even mess with the color map to change the bitmap colors when the system color changes (have to poll, no event for system color change).
    You can resize and move the subpanels using property nodes. Getting the info to do this could be tricky, however, since you may be coordinating mouse events from the top level VI and the VI hosted in the subpanel. Should be doable, though.
    One other method is to use floating windows, but move them on top of your main window so it appears to the user it is an MDI. You won't get clipping, but everything else will look the same and you won't have to jump through hoops to create title bars, etc. You will have to write a position manager to maintain the window positions, but that is probably easier than the tricks I discussed above
    Good luck. One final question - do you really need an MDI? Floating windows with clear labels are a lot easier. Do some polling of your users to find out what they like best, then go for it.
    You should using windows reparenting functionality through windows api dll calls. Reparenting is documented well on microsoft.com. Reparenting is how Excel opens multiple worksheets inside the Excel "parent" window. I have done this on a few of projects and it works far better than subpanels because it allows you to drag windows around within a parent application. They are also far easier to work with once you get the reparenting vi's correct (you have to do some messing with Z position and window activation to get them to repaint properly) because unlike with subpanels you can view a VI diagram while it is reparented with no problem. With subpanels I have also had problems with GUI controls driving event structures when a vi is in a subpanel.
    -Devin
    I got 99 problems but 8.6 ain't one.

  • Is there any way to put a folder inside a folder or increase the number of apps a folder can contain?

    I've had my iPhone 4S for awhile now and the only thing that I don't like about it is the restrictions on folders. I would like to be able to put folders inside of folders and I would like to be able to put more than 12 apps in a folder. I have a thing for keeping my phone organized and these restrictions prevent me from doing so. In fact, this drives me crazy enough that my girlfriend's Android is looking more and more appealing. I've heard that it is possible to remove these restrictions via jailbreaking but I really don't want to mess around with any of that.
    So, are there any legitimate ways of achieving this? If not, is Apple planning on modifying folder functionality?
    I hate to say it, but if the answers to both of those questions are 'no', I may have to consider getting something other than an iPhone when my next upgrade is due.

    Android phones only allow 16 apps in a folder on phones and you still can't place folders inside folders. Not sure if 4 extra apps in a folder is worth switching.

  • How to put an MSO inside another MSO

    Hello all!
    An interesting question came up in the following post by Folobo:
    http://forums.adobe.com/message/4572897#4572897
    "Is it possible to use a slideshow embedded in a big overlay slideshow?"
    I'd like to rephrase this question:
    "Is it possible to put a MultiStateObject (MSO) inside another MultiStateObject?"
    And further: if the answer is "yes", could we put that to use with the DPS?
    @Folobo – this is an interesting question. A quick test is showing that you cannot do it in the UI (correct me if I'm wrong).
    Let's try it this way:
    If you have two objects:
    1. an MSO #1 (with two rectangles, rectangle #1, rectangle #2)
    2. Another rectangle on the page: rectangle #3
    Now select the two objects and make an MSO out of it (using the "Object States" panel).
    You would think, now I get an MSO with two states, state 1 with rectangle #3 together with state 2 with MSO #1.
    But not so:
    Result: One new MSO with three states (rectangle #1, rectangle #2, rectangle #3)
    Hm. I don't give up on that. Let's try it another way:
    Could we select at least two objects inside a state of an MSO and make that a new MSO?
    Sure, We could select two objects inside a state, but since we are *inside* an MSO the "Object States" panel does not show the possibility to make a new MSO. You can only add states or add objects to states…
    Frustrating. End of story? Maybe…
    Be forewarned. The following is highly experimental!
    Let's try it by scripting (ExtendScript/JavaScript).
    The scripting reference is showing that an MSO "MultiStateObject" object has an add()-method. And further on, that add()-method could be applied to:
    Document
    Spread
    MasterSpread
    Page
    Layer
    pageItem
    And that is the key to a possible solution. We could add a new MSO to a "pageItem" object.
    A simple rectangle should be qualify for a "pageItem" object; and that, of course, could reside in a state of an MSO.
    So, we could add a new MSO to a rectangle inside of a MSO!
    How can we access a rectangle inside a MSO? Easy: We could select it and work with that selection.
    So let's do that: select the rectangle in the first state of an MSO and run this one-line-script (be sure you did select the rectangle and not the MSO or one of its states:
    app.selection[0].multiStateObjects.add();
    We now have an MSO inside another MSO!
    Explanation:
    A "generic MSO" was added with the add()-function to a selection (the container object: in our case the selected rectangle).
    The "generic MSO" is a two state MSO consisting of one rectangle in each state of a very small size (10px x 10px).
    At first it is invisible, because it is very likely that it is positioned outside the geometric bounds of its container object (the rectangle).
    But we can customize this!
    Go to the layers palette and select the new MSO, move it inside the geometric bounds of its container object, readjust its size, add states as you wish, populate the states with images, and other objects etc.pp.
    So, what can we do with an MSO inside another MSO? (As I already said, this is highly experimental.)
    My experiments with that are very fresh. I did not try a lot. But it seems that we could at least autoplay this MSO.
    I have to test more thoroughly what is possible and what will work with buttons etc.pp…
    I really like to hear from you what you will find out and if you can put it to any use.
    Uwe
    Message was edited by: Laubender

    @Mobly – in case it did not work out for you, here some screen grabs for the different steps:
    1. Select an MSO:
    2. Select a "graphic frame" inside the MSO; in this case a "<square>"; you can see the big blue dot in the Layers panel behind the generic name "<square>":
    3. Open the Scripts Panel and select the script:
    4. Run the script by double-clicking the script; the generic name of your selected object has changed to "graphic frame", but trust me, it's still a square…
    5. Click the "Ok" button of the message and InDesign will select the new MSO ("Multi-state 2") as you can see here. It has two states with one rectangle each,  fill and stroke is "None":
    And: you can see that this new MSO is nested inside the MSO ("Multi-state 1").
    What you do with that construct is up to you:
    6. Color the "<square>" of state 1 of "Multi-state 2":
    7. Resize and change position of "Multi-state 2":
    8. But remember: "Multi-state 2" is nested in the graphic frame you selected before running the script:
    I hope you get the picture now…
    Uwe

Maybe you are looking for

  • MacBook Pro underwent several repairs, problems still persisting. What should I do?

    I own a 2010 17" MBP. I have upgraded the RAM from 4GB to 8GB, removed the optical drive and installed the optibay cover (1TB HDD in the optical bay slot and 300GB SSD in the primary). Approximately about a few months before my extended warranty was

  • Creating a folder based on registation info?

    I'm creating a user and want to add a feature where when their account is created, automatically a subfolder with their username is created and they are assigned that folder (for viewing images), any ideas on how I would do this in ADDT? I know how t

  • Some files are not shown in my airport disk

    well, so far i'm impressed with my airport extreme, very stable and amazingly fast, but.... while testing access to my lacie hd over my airport connection i noticed some of my files where not available, initially i thought it was due to folder proper

  • MacBook Pro 15 (late 2013) Queries

    Hello I am planning to buy the new mbpr 2.3ghz with dual graphics. But I have a few questions. 1. THE OVERHEAT ISSUE. Is it sorted ??? or do i still have to worry about that ?? If it is still persistent, is there any solution or should I wait for the

  • Strange Problem - Cluster of References

    Hello guys I had a strange problems using a cluster with references. How to reproduce the problem: - open a blank VI; - create two graphs in the front panel; - in the block diagram, create references for both graphs; - connect these references to a b