LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-03-2004, 09:05 PM   #1
figadiablo
Member
 
Registered: Feb 2002
Location: Virginia USA
Distribution: Slackware, CentOS, Fedora
Posts: 342

Rep: Reputation: 30
MySQL: Show Table


This might be kind of a dumb question:

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.


Thanks Figa
 
Old 03-03-2004, 11:42 PM   #2
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
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.
 
Old 03-04-2004, 07:40 AM   #3
figadiablo
Member
 
Registered: Feb 2002
Location: Virginia USA
Distribution: Slackware, CentOS, Fedora
Posts: 342

Original Poster
Rep: Reputation: 30
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.



Figa
 
Old 03-04-2004, 09:30 AM   #4
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
Sure, let us know if you need more help.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to show rules in nat table? mrpc_cambodia Red Hat 2 09-26-2004 10:04 PM
MySQL non-realtime table-by-table mirroring Passive Linux - Software 1 01-20-2004 12:11 PM
How to import MS ACCESS Table including OLE filed into the MySQL Table ? myunicom Linux - General 1 11-28-2003 11:30 AM
deleted mysql table in mysql now cant do anything nakkaya Linux - Software 0 03-18-2003 06:03 PM
iptables how to show the nat table Breezer Linux - Security 1 12-13-2001 02:10 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration