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.

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?

51 Like 31 Dislike
Previous php-forum Next php-forum
Other php-forum

array_combine() error
getting an "Warning: array_combine() [function.array-combine]: Both parameters should have an e

Renaming a file that a user uploads to site?
My site allows for registered users to upload images to the site under their own gallery. Currently

md5 is it unique
I know this is most likely one of many simple questions that can be found semi easily. But I'm press

What are causes of a connection-timeout with fopen()?
Hello! Here is the situation: The server I host my website on just upgraded it's PHP build from 4.4.

Call db table from any PHP file
Hi,

I want to be able to call a database table that will be setup in another file called init

Problem with shopcart code
Hello, I am having a bit of trouble being able to add a product to my shopcart. My mysql database i

reating a background image
I am building a site in drupal and have a php form in it, due to certain annoyances with module buil

regex for quoted text within a string
I am still getting the hang of regex expressions, but I cant seem to figure out how I would escape q

php sessions,logouts & the bloomin back button!
Hi All,

I've got a cms that members can log into. When they logout, the session is destroyed,

Auto fill in input value based on User_ID
Hello,

I'm looking form some input on the following problem.

User loads page ->

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