...

View Full Version : Code Archive Script



IFeelYourPain
05-08-2009, 09:15 PM
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?

Fou-Lu
05-08-2009, 09:35 PM
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:


$criteria = '';
if (isset($_GET['l']) && strlen($_GET['l']) == 1 && ctype_alpha($_GET['l']))
{
$criteria = ' WHERE `title` = \'' . strtoupper($_GET['l']) . '%\'';
}

$sQry = "SELECT * FROM `games`" . $criteria;



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum