Closed Thread Icon

Topic awaiting preservation: MySQL Listing Alphabetical Pages that link to <a href="https://ozoneasylum.com/backlink?for=13055" title="Pages that link to Topic awaiting preservation: MySQL Listing Alphabetical" rel="nofollow" >Topic awaiting preservation: MySQL Listing Alphabetical\

 
Author Thread
marf
Bipolar (III) Inmate

From: Canada
Insane since: Oct 2001

posted posted 02-14-2004 00:26

Ok, I have a website where I post tutorials on. Now I have all my tutorials in SQL with the following table

id - Number Incremented
title - Title of Tutorial
description - Description of tutorial
picture - pretty self explanatory
date - Date uploaded
tutorial - the tutorial itself

Now On the tutorial selection Page, I want to list all the tutorials Alphabetically according tot he first letter in the 'title' column

IS there any way to do that in PHP?

Kriek
Maniac (V) Inmate

From: Florida
Insane since: Jul 2001

posted posted 02-14-2004 00:52

The ORDER BY clause is alphabetical by default, ASC (ascending)

code:
SELECT * FROM table ORDER BY title ASC



__________________

Jon Kriek
www.phpfreaks.com

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 02-14-2004 01:36

And just to clarify slightly, it's not in the PHP, it's right in your SQL - let the database do the work whenever possible.

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 02-14-2004 11:09

and read at least the select section in the mysql manual... there are a number of such goodies that the database can handle for you.

« BackwardsOnwards »

Show Forum Drop Down Menu