Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Sep 2007
    Posts
    264
    Thanks
    19
    Thanked 0 Times in 0 Posts

    Code Archive Script

    I'm looking to code something similar to this:
    http://onehitgamer.com/forum/codearchive.php

    I have gotten the page similar, but can't figure out how to get my results to bring up only certain letters like their without creating a new page for that letter. Ideas?

    Or maybe a similar script I can view to get an idea off of?

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    You'd have to modify what you have so when you're selecting you're data you're only selecting based off of $chosen%. SQL is the best option for this on indexed fields since it will index by the first letter.
    So, their code would have something like:
    PHP Code:
    $criteria '';
    if (isset(
    $_GET['l']) && strlen($_GET['l']) == && ctype_alpha($_GET['l']))
    {
        
    $criteria ' WHERE `title` = \'' strtoupper($_GET['l']) . '%\'';
    }

    $sQry "SELECT * FROM `games`" $criteria
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Posting Permissions

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