ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am writing this web base information system application for my CIS class, and basically what is does is that it creates a series of tables (to the user of the system these will be called lists), and each one holds information about videos or movies that have been edited, and also about video material used during the process of digital video editing.
I am using MySQL as previously stated, and PHP.
So basically if I want to show the user with a list of the current lists that they are using or have created, I would just do a
$result = mysql_query("SHOW tables;",$db);
// and then
echo $myrow["Tables_in_veis"]; //( this goes inside a while loop to show all tables)
// veis is the name of the database just in case.
a possible output would be:
35mm
8mm
misc
movie
Now, here comes the question: SHOW TABLES; shows the tables in alphabetical order. Is there a way to show the tables in a different order, like for example, by date created?
I could definitely create a separate table that i could use as a log to keep track of the creation of these tables and then sort using this table, but I was just wondering if there is a better and faster way.
You probably don't want to do it this way. It's usually not a good idea to return your schema information to the users. I'd suggest creating a table called 'movie format' and the rows in the table would be, 8mm, 35mm, misc. Also have a unique ID for each item. In a seperate movie table have a column for the titles and a column to link the title to the format, using just the format ID.
Thanks for the advise, I am definitely consider your advice and redesign my database a little bit better. It is in my own best interest to do it right.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.