1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Is this possible?

Discussion in 'PHP' started by Jelleke60, Dec 12, 2008.

  1. #1
    Hello,
    SEMrush
    I programmed a simple script that allows me to put information into my MySQL table using a simple form.

    Now I want to display the information like this:

    ID1(<-from my MySQL table) goes in an HTML div and ID2 goes in another div, ... And when their are like 20 DIVs on the page, it will need to create a second page and so on.

    Is this posible? If yes, could you give me a tutorial/script?

    Or is the only way getting this by putting money on the table?

    Jelle
     
    Jelleke60, Dec 12, 2008 IP
    SEMrush
  2. Agent_Smith

    Agent_Smith Well-Known Member

    Messages:
    890
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    145
  3. Jelleke60

    Jelleke60 Active Member

    Messages:
    129
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #3
    thanks!

    Seems complicated :S I think I best rent a coder for this :p.
     
    Jelleke60, Dec 12, 2008 IP
  4. chopsticks

    chopsticks Active Member

    Messages:
    565
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    60
    #4
    Not really, unless you want to have neat and tidy links at the bottom linking to the next page etc. For basics though, you need to pass along a variable in the url either being 'page' or 'start'.

    So...
    <?php
    $start = (int) $_GET['start'];
    
    $sql = "SELECT item_id, field_1, field_2, field_3 FROM table_1 WHERE what = that LIMIT {$start}, 20";
    
    // etc etc etc
    // do your mysql looping to show the results
    
    // Now make a count of how many results there actually are in the db
    $sql = "SELECT count(item_id) FROM table_1";
    // put that into a var, and use that to build the paginator with a loop
    // so for eg, in simple terms:
    $totalPages = $result_from_your_count_query;
    // loop through to get your pages
    for ( $i = 0; $i < $totalPages; $i + 20 )
    {
        echo $i  .', ';
    }
    
    Maybe that might give an idea, although it's kinda dodgey.

    Not the best solution, and possibly the worst, but just for an idea!
     
    chopsticks, Dec 12, 2008 IP
  5. misbah

    misbah Active Member

    Messages:
    265
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    68
    #5
    yes.. you can hire a coder :D
     
    misbah, Dec 12, 2008 IP
  6. Jelleke60

    Jelleke60 Active Member

    Messages:
    129
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #6
    ^^I also want to have the tiny links. But since it's not so complicated for experienced PHP'ers it wouldn't cost as much to get it done I think.
     
    Jelleke60, Dec 13, 2008 IP