Showing selected item at top of list


Posted on 16th Feb 2014 07:03 pm by admin

Hi,

I've got a list of names which i am fetching from database like this:
$qry = db_query("SELECT * FROM names");
Did you know?Explore Trending and Topic pages for more stories like this.



$i=1;

//prepair list

$html .= '<ul><li>';

while($list = db_fetch_object($qry)){



$html .= '<a>'.$list->name.'</a><div style="height:0px;"></div>';

if($i%6==0){



$html .='</li><li>';

}

$i++;

}

$html .='</li></ul>';

return $html;
Clicking on a name displays its details on next page.
Now my requirement is that i want to display the selected record on next page at the top of the list and rest coming after this record.

I am not getting a way to achieve this!

Please suggest me someway of doing this!
Thanks
No comments posted yet

Your Answer:

Login to answer
301 Like 45 Dislike
Previous forums Next forums
Other forums

PHP webpage & array print issue
I have this code running, and it works perfectly … however, see my bottom bit about what I see

login from external site
Hi my new experience begins, Now what i am trying to do is i make three pages, login.php logout.php

Array to string conversion
Can anyone help me with this?

Notice: Array to string conversion in /home/..../index.php on l

Amend code to allow multiple attachments
Hi

I have a php page that allows the user to browse to a file (image) then sumbit, the confi

FTP issues
Hi all,


I am currently facing some serious problems with a script and really need some ad

Stats of viewers
Hello. I have a website in php and people can login. I want to make an admin control panel where u c

What's wrong with my code
sobbing for many days, still don't know why please Help. Why my page isn't posted correctly. In a

links using header()
Hi All

I'm not sure where to ask for help on this but I hope someone can offer some. I'm at

Pagination
Hi All,

I think I'm finally getting somewhere with pagination!

I can now submit a quer

login form can you find my error?
registrationform.php seems fine send data to registration.php
registration.php seems fine checks

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash