Return to iWEBTOOL

Go Back   iWEBTOOL Talk > The Web and your Website > Programming > PHP
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
 
Welcome to iWEBTOOL Talk, where you talk about webmaster-related stuff.
 
Discuss topics which interest you.
With over thousands of threads (topics), we're sure you'll find something that'll interest you.
Ask for help whenever you need it.
We have thousands of members who are available to help you if you need it.
It's absolutely FREE!

 1  Register           2  Browse the board           3  Discuss whatever may interest you!
 


Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 07-10-2006, 12:00 AM   #1
jumpenjuhosaphat
 Contributor 
 
jumpenjuhosaphat's Avatar
 
Join Date: Jun 2006
Location: Denver
Posts: 4,459
jumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud of
Default Table within a table

I am trying to figure out how to insert a table within another table in mysql.
Say for instance:
I need a db for authors, so I create a table to include each authors name, then within each authors name, I need another table to list each book title, date of pulication, genre, synopsis, etc.
How do I do that?
I know how to create a table in PHP, but can't find any documentation on how to do what I am looking for. I went to PHP.net, mysql.org, w3schools, and various other places, so if you have an answer, that would be helpful.
__________________
Storage Sheds
Lost Forum
jumpenjuhosaphat is offline  
 
This is an Ad Revenue Sharing forum Place your advert here
SEO Checklist
Get yourself better ranking with
our "Do-it-Yourself" SEO Checklist.
Click Here
Old 07-10-2006, 12:07 AM   #2
Steve Myers
Junior Guru
 
Steve Myers's Avatar
 
Join Date: Jul 2006
Posts: 544
Steve Myers is a jewel in the roughSteve Myers is a jewel in the roughSteve Myers is a jewel in the roughSteve Myers is a jewel in the rough
Default Re: Table within a table

This may be the reply for this, but have a look at: http://www.webdevelopersnotes.com/tu...ng_tables.php3

EDIT: This one might of some use as well: http://www.php-scripts.com/php_diary/070700.php3

Last edited 07-10-2006 at 12:12 AM.
Steve Myers is offline  
Old 07-10-2006, 12:48 AM   #3
jumpenjuhosaphat
 Contributor 
 
jumpenjuhosaphat's Avatar
 
Join Date: Jun 2006
Location: Denver
Posts: 4,459
jumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud of
Default Re: Table within a table

Nope, that didn't have a mention of nested tables. I need to have a number that increments everytime a new entry is inserted. Okay, that's easy enough, but it increments no matter who the author is, and that is why I need a nested table.

ie....
parent table:email service
level1 table1.............level1table2.........................level1table3
id key......................id key.................................id key
some info.................some info............................some info
more info.................more info ............................more info

Thats the basic structure I am looking for, the parent table can't be the database, it has to be a table. Sorry about the periods(.), I don't know how to format text in forums yet.

I need the same structure that is used in computer filing systems, imagine if your computer didn't allow sub-folders, it would be impossible to organize your data(files). I need to organize my information in the same manner that a computer organizes its directories.
__________________
Storage Sheds
Lost Forum

Last edited 07-10-2006 at 01:52 AM.
jumpenjuhosaphat is offline  
Old 07-10-2006, 04:19 PM   #4
Daniel Malone
Senior Member
 
Daniel Malone's Avatar
 
Join Date: May 2006
Posts: 252
Daniel Malone will become famous soon enough
Default Re: Table within a table

In MySQL you can't have a table within a table!

You should have two tables, one with the list of authors, and the other with a list of books or whatever. To be specific, this is what your tables will look like:

Table: authors
Fields: id, name

Table: books
Fields: id, title, pulication_date, genre, synopsis, author_id
__________________
Webmaster News and Daniel's blog can be found at Daniel Malone
Free Webmaster Tools
Daniel Malone is offline  
Old 07-10-2006, 05:09 PM   #5
jumpenjuhosaphat
 Contributor 
 
jumpenjuhosaphat's Avatar
 
Join Date: Jun 2006
Location: Denver
Posts: 4,459
jumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud ofjumpenjuhosaphat has much to be proud of
Default Re: Table within a table

I wonder why that isn't written anywhere. There was something about ???normalization??? that made no sense, and it took me 4 hours before I figured out a way to do it. Thankyou.
__________________
Storage Sheds
Lost Forum
jumpenjuhosaphat is offline  
Old 08-05-2006, 11:20 PM   #6
thedark
Junior Member
 
thedark's Avatar
 
Join Date: Aug 2006
Posts: 18
thedark will become famous soon enough
Default Re: Table within a table

It is named Table Relationship, you will find it in any good php book. If you read a whole php book, then you will know what php and mysql can do, and if you want to do something only search for the exact syntax of the functions.
thedark is offline  
 
This is an Ad Revenue Sharing forum Place your advert here
Webmaster Tools Webmaster Tools Click Here
Closed Thread

(Threads which have no activity for more than 30 days are automatically closed.)



Quick Reply
Message:

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New table builder web tool 3w.ezer.com 123_free_links Website Reviews 4 06-26-2006 11:26 AM


All times are GMT. The time now is 05:30 AM.


Powered by vBulletin v3.6.7 © 2008, Jelsoft Enterprises Ltd. SEO by vBSEO © 2006, Crawlability, Inc.