need help on on this problem
Posted 08 May 2006 - 09:19 PM
the way its written now is that i punch in the number and have to do edit a few items beefore it actually moves up.
now what i want to do is make a link that will either move the item up or down(depending on what link is clicked) and when the link is clicked the item will move up or down.
basically how you move the forums & catories in phpbb. you click on move up and the item moves up.
any idea on how to do that?
Posted 08 May 2006 - 09:31 PM
the only thing i can think off the top of my head is to create an array of all the rows in your table and push the data up one position in the array, delete and then re-insert the rows.
but i forsee lots of problems with this.
1) would be very time consuming if you had a large table.
2) if you have unique columns, all of the data for those columns will change.
i'm sure there has GOT to be some kind of simple sql command for that...
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community
Posted 08 May 2006 - 09:37 PM
Then when you click a link it increases or decreases the number of the forum order up/down by one and then uses the ORDER BY clause in the query to order by forum order.
having a look at code may help clear up what I mean and having a look at the database structure.
Posted 08 May 2006 - 09:43 PM
Using the array info, display categories in my selected order.
As I click the move up/move down buttons, array variables are exchanged and the list is redrawn.
When it's all in the order I want, click 'save' to write the small file/table with the new order in which categories are to be displayed.
There's no need to make changes to database tables other than the one that contains category # and position in the list.
Posted 08 May 2006 - 10:08 PM
category name [txtbox to enter number]
and but i have not found any kind of help on doing that sadly.
but what if order is a number you either add to or subtract from a certain number.
like to go up add by 7 and when to go down substract by 3 or something like that. it would have to be a way that the numbers would never match up.
Posted 11 May 2006 - 01:59 AM
took some work but i found a way to make the ordering system automated.
thanks to those who replied.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users