Jump to content

Sort by Alphabet with....


phpSensei

Recommended Posts

Here is my code thats above my <head> lol, not that way...

 

<?php include("connection.php");?>

<?php 

$sql="SELECT * FROM linklist"; //Linklist Contains movie titles and name
$query= mysql_query($sql);

?>

 

Then I have a table that lists all the movie names, but I want the movie names to be sorted by order from #-z...

 

So I did this and it doesnt work

 


<?php
while ($data = mysql_fetch_assoc ($query) ){ // Here we retrieve the query from previously and make it into an array//

asort($row['list_title']); // I fetch the name of the movies from the array I just created and I sort it..i think//
echo $row['list_title'];

}

?>

 

Someone help me with this damn code, and how do you sort everthing?

Link to comment
Share on other sites

THANKS, I knew that but I just thought it starts from one row and goes down...

 

Does it do the same for dates?

 

One more question lol : How would you make it so everytime a new movie is added, there is a list like this:

 

1.300 the movie

2.cool movie

3.something

4.

5.

6.

7.

8.

 

And when a new movie is added, 300 goes down to number 2 and is replace with the new movie, and so on so on....

 

1.new movie

2.300

3.cool movie

4.something

6.

7.

8.

9.

 

???

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.