Okay, I've tried to integrate what you've mentioned above:
$movies = array();
$query = mysql_query("SELECT title, IF(SUBSTRING(title, 0, 4) = 'The ', CONCAT(SUBSTRING(title, 4), ', The'), title) as sort_title, release_year from films order by sort_title",$db);
while ($row = mysql_fetch_array($query)) {
$title = $row["title"];
$year = $row["release_year"];
array_push($movies, "$title ($year)");
}
$count = count($movies);
echo "There are currently $count movies in the database!<ul>";
foreach($movies as $movie) {
echo "<li>$movie</li>";
}
echo "</ul>";
However, this is the list that it gives me:
* 3 Men and a Baby (1987)
* A Boy, a Girl, and a Bike (1947)
* A Boy, a Girl, and a Dog (1946)
* A Child Is a Wild Young Thing (1976)
* A Girl, a Guy, and a Gob (1941)
* A Good Dissonance Like a Man (1977)
* A Guy, a Gal, and a Pal (1945)
* A Hero Ain\'t Nothin\' but a Sandwich (1977)
* A House on a Hill (2003)
* A Joke of Destiny Lying in Wait Around the Corner Like a Street Bandit (1983)
* A Man and a Woman: 20 Years Later (1986)
* A Man, a Woman, and a Bank (1979)
* A Minute to Pray, a Second to Die (1968)
* A Portrait of the Artist as a Young Man (1979)
* A Reason to Live, a Reason to Die (1974)
* A Room With a View (1985)
* A View to a Kill (1985)
* A Wave, a Wac, and a Marine (1944)
* A Whale of a Tale (1977)
* An Eye for an Eye (1981)
* An Officer and a Gentleman (1982)
* An Unsuitable Job for a Woman (1981)
* Give a Dog a Bone (1968)
* He\'s a Woman, She\'s a Man (1994)
* Like a Crow on a June Bug (1972)
* Live a Little, Love a Little (1968)
* Secuestro: a Story of a Kidnapping (1994)
* The Englishman Who Went Up a Hill but Came Down a Mountain (1995)
* The Lord of the Rings: The Fellowship of the Ring (2001)
* The Lord of the Rings: The Return of the King (2003)
* The Lord of the Rings: The Two Towers (2002)
* They Went That-a-Way and That-a-Way (1978)
* When a Man Loves a Woman (1994)
Also, movies starting with "A " and "An " should be treated the same way as movies starting with "The ".
Thanks guys!