OZONE Asylum
Forums
Server-Side Scripting - Oh my!
Sort by last name (PHP - MySQL)
This page's ID:
28658
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Also, you don't need to use a 26-character long set of switch cases to achieve this. First, you'd check if the input is an alpha character using: [code] if(ereg('[A-Za-z]',substr($_GET["alpha"],0,1))) { $query = "SELECT * FROM contact WHERE lastname LIKE '".strtoupper(substr($_GET["alpha"],0,1))."%' ORDER BY lastname ASC"; } else { $query = NULL; } [/code] Then, before you run the query, check to see if $query is null, and if so, don't run it, return an error message. [url=http://sunday.yarinareth.net][img]http://members.ii.net/~skaarjj/tempus.gif[/img][/url] Justice 4 [url=http://www.justice4pat.com]Pat Richard[/url] [small][edit: okay, wrong superglobal array, there... I used $_POST instead of $_GET][/small] [small](Edited by [url=http://www.ozoneasylum.com/user/157]Skaarjj[/url] on 11-28-2006 01:14)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »
Maximum Security
OZONE
DHTML/Javascript
Server-Side Scripting - Oh my!
CSS - DOM - XHTML - XML - XSL - XSLT
Stupid Basic HTML
Visual Therapy
Photoshop
Photoshop Pong, Anyone?
***WARNING*** BIG SIG APPROACHING
Photography
3D Modelling & Rendering
Multimedia/Animation
Print Graphics
Holding Pens
Philosophy and other Silliness
Outpatient Counseling
Site reviews!
Mad Scientists' Laboratory
Getting to know the Grail