Jump to content

Recommended Posts

No, sorry let me tell you again, i havnt explained it properly....

instead of

alfa.co.uk--------------------1000
bravo.co.uk-----------------500
charlie.co.uk----------------400
cabbage.co.uk----------------400
dikkins.co.uk----------------200

i want them listed like;

1000
alfa.co.uk

500
bravo.co.uk

400
charlie.co.uk
cabbage.co.uk

200
dikkins.co.uk
Link to comment
https://forums.phpfreaks.com/topic/9926-a-to-z-list/#findComment-37093
Share on other sites

I guess if you are talking of displaying , then it can be done with code on the front end. Something like this

[code]
<?php
//make db connection here

$query = "SELECT * FROM table XYZ order by hits desc";
$result = mysql_query($query) or die (mysql_error());
$num = mysql_num_rows($result);
$current_price = 0;
for($i=0;$i<$num;$i++) {
    $row = mysql_fetch_array($result);
    if($row['hits'] != $current_price) {
    echo $row['hits']."<br>";
    $current_price = $row['hits'];
    }
    echo $row['url']."<br>";
}
?>
[/code]

I have not tested this code, but should work.

hth

Link to comment
https://forums.phpfreaks.com/topic/9926-a-to-z-list/#findComment-37095
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.