Jump to content

Recommended Posts

if (isset($_GET['orderby'])) {

$order = $_GET['orderby'];

$query = "SELECT * FROM songs ORDER BY $order";

}

$query = "SELECT * FROM songs";

$result = mysql_query($query) or die('Query failed: ' . mysql_error());

 

That should be all the code you need. So i put URL or :

 

www.wezzsmusic.ifastnet.com/WM/music.php?orderby=Title

 

and they dont change. Have a look at that page and see what you can do...

 

You'll need to login.

 

user = test

pass = abc123

 

Thanks,

 

SNooble

Link to comment
https://forums.phpfreaks.com/topic/40707-order-by-problem-should-be-easy/
Share on other sites

Your overiding your $query variable with this line.

 

$query = "SELECT * FROM songs";

 

Your code needs to be more like....

 

<?php

  if (isset($_GET['orderby'])) {
    $order = $_GET['orderby'];
    $query = "SELECT * FROM songs ORDER BY $order";
  } else {
    $query = "SELECT * FROM songs";
  }

  // more code.

?>

wezzsmusic.ifastnet.com/WM/music.php

 

sign in with

 

username = test

password = abc123

 

that link works, copy and paste it. navigate to the tab "MUSIC" and then you can see my trobule. It's hard to explain.

 

Numbers are shown like

 

1

10

2

29

 

...

 

But even with the song title you should have AAAAAA before Arnold

 

??

 

Snooble

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.