472,108 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,108 software developers and data experts.

MySQL & re-ordering entries

6
Hey, I'm new to MySQL and web development as a whole. I designed and put up a website at ArtistsVale , effectively the bulk of the site is an Image gallery which I created through Fireworks/Dreamweaver/Painter.

I have a problem, however, with my gallery list on the site. I wanted to create the ability to reorder the list in my administration, however I've got no idea how to go about it or where to start. I contemplated messing with the IDs, but I read its good practice not to touch them and find other ways to do it.

Is there a way to assign each album some other unique ID upon creation and then have the ability to move them around in my gallery list?

Thanks!
Kevin
Jul 2 '07 #1
5 1620
r035198x
13,262 8TB
Hey, I'm new to MySQL and web development as a whole. I designed and put up a website at ArtistsVale , effectively the bulk of the site is an Image gallery which I created through Fireworks/Dreamweaver/Painter.

I have a problem, however, with my gallery list on the site. I wanted to create the ability to reorder the list in my administration, however I've got no idea how to go about it or where to start. I contemplated messing with the IDs, but I read its good practice not to touch them and find other ways to do it.

Is there a way to assign each album some other unique ID upon creation and then have the ability to move them around in my gallery list?

Thanks!
Kevin
Normally you don't want to order data in the database but change it's order in the views that you extract from it. i.e The ordering should be specified at each connection depending on the user extracting the data.
Jul 2 '07 #2
lilkev
6
Normally you don't want to order data in the database but change it's order in the views that you extract from it. i.e The ordering should be specified at each connection depending on the user extracting the data.
Ah OK, forgive me if I'm a little slow though. I think I see where your coming from, like for example how the users can sort entries by date or name etc.?

What I was more interested in though, was sorting the entries into a custom order, more for aesthetic value, or so that I can put similar items into groups that can't be ordered by any of their property values.

I'm not even sure if its possible? Should I be asking this in the PHP forum?

Thanks again!
Kevin
Jul 2 '07 #3
r035198x
13,262 8TB
Ah OK, forgive me if I'm a little slow though. I think I see where your coming from, like for example how the users can sort entries by date or name etc.?

What I was more interested in though, was sorting the entries into a custom order, more for aesthetic value, or so that I can put similar items into groups that can't be ordered by any of their property values.

I'm not even sure if its possible? Should I be asking this in the PHP forum?

Thanks again!
Kevin
I'm not sure I fully understand what you mean but I have a feeling this might be done on the front end using PHP or maybe even Javascript.
Jul 3 '07 #4
lilkev
6
Like, for example, currently my gallery list is:

* Drawings
* VAR 32
* VSW 33
* Work Pre-2002
* Work 2002-2006
* Digital Art
* Architecture
* The Word

I was hoping to gain the ability to just shove the entries into a different order where I want them, without being restricted to sorting by name or date etc. So if I felt like it, I could just move 'Drawings' below 'VSW33', or move 'Digital Art' above 'VAR 32' via my administration. Hope that makes it a little clearer.

I'm no expert on the matter, but I think it will still require some work from the database to order the entries?

Thanks, Kevin.
Jul 3 '07 #5
Like, for example, currently my gallery list is:

* Drawings
* VAR 32
* VSW 33
* Work Pre-2002
* Work 2002-2006
* Digital Art
* Architecture
* The Word

I was hoping to gain the ability to just shove the entries into a different order where I want them, without being restricted to sorting by name or date etc. So if I felt like it, I could just move 'Drawings' below 'VSW33', or move 'Digital Art' above 'VAR 32' via my administration. Hope that makes it a little clearer.

I'm no expert on the matter, but I think it will still require some work from the database to order the entries?

Thanks, Kevin.
You could simply add a column to your table named item_order (or anything, really), and use this in your database query, e.g.
Expand|Select|Wrap|Line Numbers
  1.  SELECT * FROM $table ORDER BY item_order 
.
The field item_order can then be edited in a form through PHP/mySQL, or directly in mySQLadmin.

cheers,
McErrick
Jul 20 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by AF | last post: by
2 posts views Thread by iwasinnihon | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.