Current location: Hot Scripts Forums » General Community » Script Requests » ordering the rows manually


ordering the rows manually

Reply
  #1 (permalink)  
Old 12-21-04, 04:11 PM
computerages computerages is offline
Newbie Coder
 
Join Date: Dec 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
ordering the rows manually

hey eveyone!

I am looking for a php script which would let me order the rows manualy instead of table's id, or something like it...

If you still don't understand what I am looking for:

http://img149.exs.cx/img149/5218/untitled7fk.png

waiting for your reply...thanks!
Reply With Quote
  #2 (permalink)  
Old 12-22-04, 12:16 AM
rmurdo rmurdo is offline
Newbie Coder
 
Join Date: Jul 2003
Posts: 54
Thanks: 1
Thanked 0 Times in 0 Posts
Ordering.

Hi there,

There are probably a dozen ways to do this. What I do is make a field (indexed) called order. You then have an editor with drop down boxes, it reads all the records in then create a dyamic drop down for each one that goes from 1 to total records. Then you can choose what order that drop down is. Save/update the db.

Then you can do a select statement that orders by the column order and not id.

Make any sense?

Robert
Reply With Quote
  #3 (permalink)  
Old 12-22-04, 12:38 AM
computerages computerages is offline
Newbie Coder
 
Join Date: Dec 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by rmurdo
Hi there,

There are probably a dozen ways to do this. What I do is make a field (indexed) called order. You then have an editor with drop down boxes, it reads all the records in then create a dyamic drop down for each one that goes from 1 to total records. Then you can choose what order that drop down is. Save/update the db.

Then you can do a select statement that orders by the column order and not id.

Make any sense?

Robert
Firstly, thanks for the help and your informative reply!!

And it does make sense to me, but I don't understand that how would I make a dyamic drop down menu? COuld you please post that script here?

Thanks again for the help. It is greatly appreciated.
Reply With Quote
  #4 (permalink)  
Old 12-22-04, 12:49 AM
xtremenw xtremenw is offline
Newbie Coder
 
Join Date: Dec 2004
Location: Tacoma, WA
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by computerages
Firstly, thanks for the help and your informative reply!!

And it does make sense to me, but I don't understand that how would I make a dyamic drop down menu? COuld you please post that script here?

Thanks again for the help. It is greatly appreciated.
Here is how I do it...

print ("<select name=dropdown1>");
while ($row = mysql_fetchrow_array(SELECT order from table))
{
print ("<option value=" . $row[0] . ">" . $row[0]);
}

Not sure if everything is correct. My PHP is a little rusty...
Reply With Quote
  #5 (permalink)  
Old 12-22-04, 12:52 AM
rmurdo rmurdo is offline
Newbie Coder
 
Join Date: Jul 2003
Posts: 54
Thanks: 1
Thanked 0 Times in 0 Posts
Selects..

Ya.. That looks like the right idea!

Robert
Reply With Quote
  #6 (permalink)  
Old 12-22-04, 01:11 AM
computerages computerages is offline
Newbie Coder
 
Join Date: Dec 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for the help both of you... But unfortunately I still don't get it... could you guys please post the entire script here... because I am tottaly new to mysql and php..

Thanks again!
Reply With Quote
  #7 (permalink)  
Old 12-22-04, 01:59 AM
xtremenw xtremenw is offline
Newbie Coder
 
Join Date: Dec 2004
Location: Tacoma, WA
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by computerages
Thanks for the help both of you... But unfortunately I still don't get it... could you guys please post the entire script here... because I am tottaly new to mysql and php..

Thanks again!
I would but I need to goto bed. If there is no reply by tomorrow from rmurdo tomorrow in the later am, i will do it.

you can always email me if you have questions...

I pm'd you my email addy...
Reply With Quote
  #8 (permalink)  
Old 12-23-04, 11:29 AM
computerages computerages is offline
Newbie Coder
 
Join Date: Dec 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by xtremenw
I would but I need to goto bed. If there is no reply by tomorrow from rmurdo tomorrow in the later am, i will do it.

you can always email me if you have questions...

I pm'd you my email addy...
I think rmurdo is gone...
Reply With Quote
  #9 (permalink)  
Old 12-24-04, 01:21 AM
computerages computerages is offline
Newbie Coder
 
Join Date: Dec 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
I am still waiting.....
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
delete duplicate rows in mysql using php seans9 PHP 4 07-16-08 09:42 PM
how to validate mutiple rows using the same input text Han84 JavaScript 1 08-02-07 09:14 AM
Help with echo'ing rows of (td's) from database entries paulj000 PHP 6 04-20-04 09:32 AM
counting rows geemuse PHP 3 04-19-04 01:54 PM
can't edit multiple rows at the same time conundrum PHP 2 04-01-04 12:50 AM


All times are GMT -5. The time now is 10:57 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.