Current location: Hot Scripts Forums » Programming Languages » PHP » phpmyadmin and the Entity-Relationship Model


phpmyadmin and the Entity-Relationship Model

Reply
  #1 (permalink)  
Old 04-01-04, 04:20 PM
jacobo jacobo is offline
Newbie Coder
 
Join Date: Jun 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Question phpmyadmin and the Entity-Relationship Model

hello i dunno if this is the right place to post my msg so if it's not forgive me. i'm using phpmyadmin and want to know if i can use Entity-Relationship Model for my tables.

thanks.
Reply With Quote
  #2 (permalink)  
Old 04-01-04, 10:37 PM
blaw's Avatar
blaw blaw is offline
Junior Code Guru
 
Join Date: Dec 2003
Location: Vancouver, BC, Canada
Posts: 550
Thanks: 0
Thanked 0 Times in 0 Posts
Hi,

phpMyAdmin is merely an interface to your database, whereas E-R model is a theory(design technique or whatever you may call) - a quick answer to your question is still yes, you can design your database in an E-R way and browse your tables, etc, via phpMyAdmin, but phpMyAdmin can't tell you which table should be related to which table, and so forth.

If you know enough SQL to do what you want, I strongly recommend that you design your database structure in SQL and import the SQL file(s) from phpMyAdmin. It's often faster that way.

My 22 cents. =)
__________________
Blavv =|
Reply With Quote
  #3 (permalink)  
Old 04-02-04, 05:16 AM
jacobo jacobo is offline
Newbie Coder
 
Join Date: Jun 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
ok what i need is to do something like this using phpmyadmin:

http://www.utexas.edu/its/windows/da...ing/dm/er1.gif

thanks.
Reply With Quote
  #4 (permalink)  
Old 04-02-04, 02:29 PM
Puno Puno is offline
Newbie Coder
 
Join Date: Mar 2004
Location: Spain (EU) Colorado (USofA)
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Talking

Quote:
Originally Posted by jacobo
ok what i need is to do something like this using phpmyadmin:

http://www.utexas.edu/its/windows/da...ing/dm/er1.gif

thanks.
I will ask one silly question, just in case...
Do you need to produce the diagram itself (graphic) of the structure in the DB?
If (firstquestion == true) then I dont think that the tools supports graphical design.
If you need to recreate the structure then yes you can do it with that tool with no problems at all.

To be able to relate the tables you need a field know as a foreign key, which is nothing more than keeping your register's primary key from the first table stored in the register of the second table.

Thus tables would look like so:

t_department
=============
pk_department
... (more fields)


t_project
=============
pk_project
fk_department <---- This is where you store the pk_department of the department that carries this project
... (more fields)


Through the use of Relations by means of Foreign Keys you can have nifty things like Referential Integrity.

If I used any terms you did not cover yet, feel free to ask what they are or their use.
Hope this is what you were asking for. If not, again, feel free to point me to it.

PD: important, due to Referential Integrity t_department must be created before t_project, and registers must be stored first into t_department than t_project.

Good luck.
__________________
Puno Bleedingrose,
Spectrum 48K BASIC's was cooler, it had a BEEP instruction.
Reply With Quote
  #5 (permalink)  
Old 04-02-04, 02:51 PM
jacobo jacobo is offline
Newbie Coder
 
Join Date: Jun 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Puno
I will ask one silly question, just in case...
Do you need to produce the diagram itself (graphic) of the structure in the DB?
If (firstquestion == true) then I dont think that the tools supports graphical design.
If you need to recreate the structure then yes you can do it with that tool with no problems at all.

To be able to relate the tables you need a field know as a foreign key, which is nothing more than keeping your register's primary key from the first table stored in the register of the second table.

Thus tables would look like so:

t_department
=============
pk_department
... (more fields)


t_project
=============
pk_project
fk_department <---- This is where you store the pk_department of the department that carries this project
... (more fields)


Through the use of Relations by means of Foreign Keys you can have nifty things like Referential Integrity.

If I used any terms you did not cover yet, feel free to ask what they are or their use.
Hope this is what you were asking for. If not, again, feel free to point me to it.

PD: important, due to Referential Integrity t_department must be created before t_project, and registers must be stored first into t_department than t_project.

Good luck.

hi that's exactly what i need, thanks
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 10:22 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.