Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sort dataBase Table


Guest

Recommended Posts

Ok i can not seem to find any button or MySQL orders to be able to Sort the database tables.

 

Example would be, if you wnat all your products in the list to be in proper order.

 

1.

2.

3.

 

 

and so on..

 

 

Not

1.

31.

45.

67.

 

 

Thanks

Link to comment
Share on other sites

I not sure that is what i mean't

 

let me explain further, in the MySql database when you are adding products to it and delete one, you are let with a messed up order ID list.

 

instead of having

 

1. Fish sticks

2. Chunky Fish sticks

3. out of bound fish sticks

 

 

you have

 

1. fish sticks

3. out of bound fish sticks

4. gobble fish sticks

2. smoke fish sticks

 

 

 

 

and so on and so on.

 

 

How can i sort the data base to be the way it was in the beginning.

 

 

Thanks

Link to comment
Share on other sites

I'm not sure I've undertood you right...

 

If you need to sort products list in your admin section, you need to install a contribution (by default osCommerce sort products by their name).

 

If you need to sort entries when you execute MySql query, just add 'order by products_id' to the end of the query.

Best regards,

Taras

Link to comment
Share on other sites

I want to sort them out in the MySql database not the ocommerce Admin

 

 

This is what I don't want

 

 

23

24

25

26

27

31

30

32

 

 

Sure I did the query thing and yes the Query corrects it, but only in the Query not Permently as if you go back to browse the Messed up order is still the same.

 

As for the Name being sorted first that is not true as the number 31 Item name should be under the 32 number name if it were sorting by name.

 

I forget how to sort the table so it stays that way for good until you have to do it again.

 

Thanks

 

Please help more if you can understand what i am talking about.

 

Anyone please.

Link to comment
Share on other sites

Ok I found out how to do it again

 

now all of you read carefully.

 

Go to Operations and where it says

 

Alter table order by : products_id

 

Change it to alter by weight or any other one in the list then go and alter it back to products_id

 

I am not sure but if you run the query....

 

alter table order by products_id

 

this might work too.

 

 

Remembr that every table is different where product_id would be different.

 

Example:

 

categories_id

 

 

and so on.......

 

Thanks for the help.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...