473,698 Members | 2,183 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MySQL & re-ordering entries

6 New Member
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 1733
r035198x
13,262 MVP
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 New Member
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 MVP
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 New Member
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
McErrick
1 New Member
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

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

Similar topics

7
3361
by: AF | last post by:
I am a real novice to php and MySQL, with about a week's worth of reading and self tutoring. I have an urgent need to publish a database of information and need some guidance on how to do this. This question might be more suited to a MySQL newsgroup, but since php and MySQL seem to have become almost married to one another, and since getting the data out and displaying it is where my problem seems to lie, I thought I would start with...
2
2291
by: iwasinnihon | last post by:
I don't usually like to do this, but I need help. I have gone over this code and cannot figure out why it doesn't work. First of all it doesn't check to see if you have filled in the required fields. Second, it doesn't submit the information (it's supposed to send it to mySql and email it to me.) and lastly, it doesn't bring up the thankyou.php after submitting the form. I don't know enough about PHP to find the problem. If someone could...
0
1964
by: Donald Tyler | last post by:
Yes it can. But you should understand the three distinct levels of that situation. You need the following: Database Web Server Server-Side Scripting Language I would suggest using AMP (Apache, MySQL & PHP). If you want to know more
0
5664
by: aars | last post by:
Hello all, I am creating a user administration system where system administrator can activate services for a user, like webspace, a mail account or a subdomain. I now want to create a function that creates mysql databases and grant the right privileges to a user. But the problem is that mysql wants to have the plaintext password for the user in the "grant ... identified by 'pwd'" field, or in a manual query to update the password in...
4
2807
by: MLH | last post by:
A programmer developed an AMP (Apache/MySQL/PHP) application for me. When he was done, he sent me the PHP files and the MySQL dump file. Now, when I connect to the application on my LAN using http://192.168.1.106/~mlh/credifree/index.php the AMP app still thinks the data resides somewhere else. It runs fine - as long as I leave my LAN's external internet connection up. But if I unplug my LAN from the world, my app locks up. Before I...
2
6700
by: zhengfish | last post by:
Hi,All, I try to install mysql-5.0.15 on RHEL3-U5. But It give me a error. MySQL-client-standard-5.0.15-0.rhel3.i386.rpm MySQL-devel-standard-5.0.15-0.rhel3.i386.rpm MySQL-server-standard-5.0.15-0.rhel3.i386.rpm MySQL-shared-standard-5.0.15-0.rhel3.i386.rpm MySQL-standard-debuginfo-5.0.15-0.rhel3.i386.rpm
0
2217
by: taras.di | last post by:
Hi everyone, I've come across an extremely strange problem. The exact same query in both mysql command line client, and mysql query browser gives entirely different results. I was hoping someone out there could shed some light. Ok, the query (I've stripped it bare, the real query is a bit more complex)...
1
3605
by: cumupkid | last post by:
II am trying to create a form that will allow me to upload photos to a folder in the site root directory and add the information to the mysql db at the same time. I have created two forms, one that uploads to photo to the folder in the site root diorectory. One that uploads the info to mysql database. but... When I try to upload them both ways at the same time i cant get it. I am Including code for both pages i have working. Code for...
3
3217
by: jonathan184 | last post by:
The code seems to be working fine for some records but I am thinking it is finding some other records with special characters and so on. I am looking for a way to insert the xml string with escaping a bunch of chars This is the message i got DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your M ySQL server version for the right syntax to use near 'd to test@email.com...
3
3546
by: subho2009 | last post by:
Hello friends, I have face a problem, the problem is that when i fetch data from mysql database i get '&' in the place of '&'. I am using php 5.1.2 and mysql version 5.0.11-beta. What is the problem? any body solve my problem? Please answer me. Thanks in advance!
0
8674
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9023
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8893
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4366
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3045
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2327
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1999
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.