Custom list order


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

Hi there,

I have checked this tutorial and it's great till the point where I want to display my data by a variable.

Did you know?Explore Trending and Topic pages for more stories like this.
Let's say that I have in my table these fields:
- id
- name
- usort
- category

I want to display the information by category. But then, when I use the script described in the tutorial, it does not work properly as it changes the position in the table by +/-1, not with the row I want it to be changed with. Ultimately it will work when it goes up/down the appropriate row.

I guess there should be a way of fixing that by swapping the usort number, but I have to admit that my skills do not allow me to do that.

Does anyone have an idea how I could do what I would like to do?
No comments posted yet

Your Answer:

Login to answer
51 Like 31 Dislike
Previous forums Next forums
Other forums

get multiple rows
Hi I want to get multiple rows from a db

I am using this for the db query
Code: public

HTML Email rec'd as Source Code
The code does create and send the email successfully. However, the message shows as html code and n

Undefined variable when using $_SERVER['PHP_SELF']
Hi guyz, please suggest me something...
On first.php I have one input field NAME, and on posting

Rounding a number queried from a database
I know that to display a rounded number you just do echo "round($number)";. But how would

Multi language - seo links
Im trying to figure out the best method to have a multi language website that will function with seo

Is this Safe or Unsafe?
Hi i made a few pages with lots of peoples help now i just want to know if they are safe or not can

Alternate messaging
I have 4 strings in MySQL db1

$string1 : Hello
$string2 : Hi
$string3 : Great
$strin

Pagination won't carry results past page 2.
Hi all,

I've worked out my pagination script and its paginating fine until I click next from

Send inserts to mysql thru port 80
Hi!

I have an application that must do some inserts in a mysql db. This db is behind a firewa

System copy error in RUN ABAP REPORT PHASE
Hi,
I am performing system copy on my test server. I have previously taken export of JAVA + A

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