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

TemplatePower & AJAX
Hi all,



I'm currently implementing some AJAX features in my PHP-framework (which is b

Match stored value with the current value in a loop
Hello,

I have a MySQL db were I store articles in.

I have a form to fill these article

Preventing SQL Injection
I have a question about SQL Injection, In some of our code we use this: view plaincopy to clipboa

Why is my row count 0?
Here's the MySQL query i'm running. It basically pulls data from 2 tables based on some data passed.

PHP XML extraction text
I would like to extract an xml text and have that text directly echo(print) out on my web page. Her

Problem related to Creation of PDF File?
Hi All,
I am facing a problem related to creation pdf file. when I am creating a pdf file of do

unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_
Can anyone view my code and tell me why im getting the error:
Parse error: syntax error, unexpect

Connect to database that isn't localhost
I am currently doing a small script for a company that doesn't have mySql support on there hosting.

Multithreading in Oracle (Java, SQLJ, Pro*C,??) on 10g
I am investigating how to run a Java stored procedure in multithread mode.
I know that if I chang

Only add new information from XML to MySQL
What I am doing, is taking a xml file, and adding the values to a database. However, what I want to

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