Professional Web Applications Themes

Coding Question - PHP Development

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I am currently trying to think of how I want to solve an issue, and im looking for some input. I have a page that will query information from a database and then properly display it on the screen. Now the thing I want to set up is the option to split the information over 2,3 or more pages. For example, the user can set a value in the config file for how many results to display for page, then on each page ill have something that says results 25-50 here and what ...

  1. #1

    Default Coding Question


    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Hello,

    I am currently trying to think of how I want to solve an issue, and
    im looking for some input.

    I have a page that will query information from a database and then
    properly display it on the screen. Now the thing I want to set up is
    the option to split the information over 2,3 or more pages.

    For example, the user can set a value in the config file for how many
    results to display for page, then on each page ill have something
    that says results 25-50 here and what not.

    The only thing that comes to my mind, is somehow setting up some
    tests, and then altering the sql statement with the list option. Is
    this the best way to do this? Does anyone else have any other
    suggestions??

    Thanks in advance for the assistance.

    - ---
    Aaron Axelsen
    AIM: AAAK2
    Email: [email]axelseaaamadmax.com[/email]

    Want reliable web hosting at affordable prices?
    [url]www.modevia.com[/url]

    Web Dev/Design Community/Zine
    [url]www.developercube.com[/url]


    -----BEGIN PGP SIGNATURE-----
    Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

    iQA/AwUBPxpK1brnDjSLw9ADEQK0cQCgmFLBwO/IeqIYZIJUhR2j23Na5/sAniYv
    nXehy/vKSs6AE8/yI3O9BixJ
    =s7G2
    -----END PGP SIGNATURE-----


    Aaron Axelsen Guest

  2. #2

    Default Re: [PHP] Coding Question

    Retrieving the results can be LIMITed to X results starting at row Y
    using mysql's LIMIT function.

    Check the MySQL manual, but basically, this will limit the result to 10
    rows, starting with row 5.

    SELECT name FROM customers LIMIT 5,10


    By taking your values for the starting point and row count from
    variables from within the url, a posted form, session, cookie, etc, you
    can build dynamic queries, eg:

    $sql = "SELECT name FROM customers LIMIT {$start},{$perPage}";


    You can also build next and previous links by adding and subtracting
    the $perPage to the $start.


    Make sense?


    There's plenty of tutorials -- just do a google search.


    Justin



    On Sunday, July 20, 2003, at 05:55 PM, Aaron Axelsen wrote:
    >
    > -----BEGIN PGP SIGNED MESSAGE-----
    > Hash: SHA1
    >
    > Hello,
    >
    > I am currently trying to think of how I want to solve an issue, and
    > im looking for some input.
    >
    > I have a page that will query information from a database and then
    > properly display it on the screen. Now the thing I want to set up is
    > the option to split the information over 2,3 or more pages.
    >
    > For example, the user can set a value in the config file for how many
    > results to display for page, then on each page ill have something
    > that says results 25-50 here and what not.
    >
    > The only thing that comes to my mind, is somehow setting up some
    > tests, and then altering the sql statement with the list option. Is
    > this the best way to do this? Does anyone else have any other
    > suggestions??
    >
    > Thanks in advance for the assistance.
    >
    > - ---
    > Aaron Axelsen
    > AIM: AAAK2
    > Email: [email]axelseaaamadmax.com[/email]
    >
    > Want reliable web hosting at affordable prices?
    > [url]www.modevia.com[/url]
    >
    > Web Dev/Design Community/Zine
    > [url]www.developercube.com[/url]
    >
    >
    > -----BEGIN PGP SIGNATURE-----
    > Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
    >
    > iQA/AwUBPxpK1brnDjSLw9ADEQK0cQCgmFLBwO/IeqIYZIJUhR2j23Na5/sAniYv
    > nXehy/vKSs6AE8/yI3O9BixJ
    > =s7G2
    > -----END PGP SIGNATURE-----
    >
    >
    >
    > --
    > PHP General Mailing List ([url]http://www.php.net/[/url])
    > To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
    >
    > ---
    > [This E-mail scanned for viruses]
    >
    >
    Justin French Guest

Similar Threads

  1. php coding
    By Unregistered in forum Brainstorming Area
    Replies: 0
    Last Post: April 18th, 12:07 PM
  2. help in coding
    By fsurrey in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 1
    Last Post: September 5th, 08:03 AM
  3. coding
    By Tim A. Setliff in forum Macromedia Flash Actionscript
    Replies: 2
    Last Post: January 24th, 02:52 PM
  4. Lil fun be4 coding
    By Julien CROUZET aka c2c in forum PHP Development
    Replies: 0
    Last Post: September 2nd, 02:45 PM
  5. Question coding a database app for Mac OSX
    By Kipp Chambers in forum Mac Programming
    Replies: 14
    Last Post: August 21st, 03:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139