Reply to Please Help !!! I need to sort an Array !!!

Your name:

Reply:


Posted by Angelos on 11/18/05 12:25

Current Case:
I have a table in a database

PRODUCTS
--------------
product_id
product_name
product_category
product_order
_______________________
I am trying to create a change order script. With Up/Down links.

So I run my querry and store the data in the database. So I end up with an
array

ID | 22 | 27 | 30 | 37 | 40 |
CATEGORY | 2 | 2 | 2 | 2 | 2 |
------------------------------------------
ORDER | 1 | 2 | 3 | 4 | 5 |

Now when I click the UP link for example on ID 30 it sends a querry
?move_id=30&to_id=27
Ofcourse there are other ways of doing that but what I want to do is MOVE
products from category to category and then the problem is that I may end up
MOVING for example product with ID 45 CATEGORY 4 and ORDER 2 so the above
array will look like:

ID | 22 | 45 | 27 | 30 | 37 | 40 |
CATEGORY | 2 | 2 | 2 | 2 | 2 | 2 |
------------------------------------------
ORDER | 1 | 2 | 2 | 3 | 4 | 5 |

and after that what I want to do is reset the order positions and re-number
then 1,2,3,4,5,6

Can anyone give me some HELP PLEASE !!!!
Thank you...

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация