CariDotMy

 Forgot password?
 Register

ADVERTISEMENT

View: 2416|Reply: 18

Macamane nak link table?

[Copy link]
Post time 6-8-2007 01:22 PM | Show all posts |Read mode
hello!!...nak tanya sume, macamana nak link table mysql yakni, mysql yang kat dalam wamp tu?

Rate

1

View Rating Log

Reply

Use magic Report


ADVERTISEMENT


Post time 7-8-2007 10:22 AM | Show all posts
minta maaf tak tahu...
kekawan lain sila tolong
Reply

Use magic Report

Post time 7-8-2007 10:36 AM | Show all posts
soalan terlalu general. boleh specific sikit?
Reply

Use magic Report

 Author| Post time 7-8-2007 06:17 PM | Show all posts

Reply #3 shahnazz's post

okay..kalo dalam mic.access kita boleh link kan table table or make relationship
one to many, many to many, and other else which kita boleh set kan primary key dan foreign key.

but now, i use wamp.dalam wamp tu kan dia sekalikan mysql+apache+php.
n now saya tak tau macamana nk buat buat relationship table2 kat mysql.

any idea?
Reply

Use magic Report

Post time 7-8-2007 10:06 PM | Show all posts

Reply #4 HishamZ's post

yang ni guna phpmyadmin tu ke??..
lau phpmyadmin takde related untuk foreign key tu...sebab yang tu just create table dan field...
tapi lau dalam mysql command prompt.. yang ni bleh sebab kita taip arahan semua....

tapi soalan awak ni general la..leh detailkan lagi..takut saya tersalah pemahaman la plak la kan..
Reply

Use magic Report

Post time 8-8-2007 09:44 AM | Show all posts
oh

mysql tak sama dengan microsoft access.
mostly primary keys and foreign keys you have to define masa nak create table tu. phpmyadmin is only a UI for mysql database management. biasanya dalam microsoft access you define relationships so that when you create queries in microsoft access, the results would come out properly. actually by defining relationships in microsoft access you are only simplifying your task of scripting in SQL to manage the relationships.

if you look carefully in microsoft access queries, when you establish relationships between tables in your queries, try and look at the SQL code underneath. you will find a lot of JOIN statements (LEFT JOIN, RIGHT JOIN etc), yang tulah u kena pakai dalam MySQL bila nak establish relationships.

correct me if i am wrong
Reply

Use magic Report

Follow Us
Post time 8-8-2007 10:22 AM | Show all posts
actually, in mysql kita boleh wat relationship if kita gunakan innodb engine. hishamz, kalo u gunakan phpmyadmin, bila u create table, automatically table tu guna myisam engine. so kalo u nak gunakan innodb engine, masa u create table u kena define la yg u nak gunakan engine ape. cthnya mcm ni:

CREATE TABLE table1 (                                   
           a varchar(10) NOT NULL,                     
           b varchar(50) NOT NULL,                     
           PRIMARY KEY  (a)                             
         ) ENGINE=InnoDB

Rate

1

View Rating Log

Reply

Use magic Report

Post time 8-8-2007 10:32 AM | Show all posts

Reply #7 keychain's post

ooo innodb boleh create relationships ek?

so kalau nak buat delete from primary table dia akan delete automatically from foreign table ke? (macam cascade delete)
Reply

Use magic Report


ADVERTISEMENT


Post time 8-8-2007 11:34 AM | Show all posts
Originally posted by shahnazz at 8-8-2007 10:32 AM
ooo innodb boleh create relationships ek?

so kalau nak buat delete from primary table dia akan delete automatically from foreign table ke? (macam cascade delete)


yes boleh.. either nak on update cascade ke..delete cascade ke..
Reply

Use magic Report

Post time 8-8-2007 02:53 PM | Show all posts
ooo good info, baru saya tau, nah credits for u
Reply

Use magic Report

 Author| Post time 8-8-2007 03:55 PM | Show all posts

Reply #7 keychain's post

okay..paham..maknanya,kita just declare kat table yg kita nak link tu foreign key la kan?automatic linked la
kiranya ye.

just nak tanya perbezaan database engine, innodb,myisam, and a fews..lain ke fungsinye?
Reply

Use magic Report

Post time 8-8-2007 07:29 PM | Show all posts
Hati-hati bila guna mysql innodb. Klu nak buat application yang support transaction, OK. Tapi kalau application yang simple, cukup pakai MyISAM je.

-Antara kelemahan innoDB, tak bleh main copy database folder & masuk dlm  dalam mysql server dr pc yang berlainan (ni aku try kat LINUX, windows x pasti), Slow sikit masa insert data.
Reply

Use magic Report

Post time 9-8-2007 10:08 AM | Show all posts

Reply #11 HishamZ's post

ha ah.. gi tu je..
setiap engine mysql tu utk fungsi yg berbeza2.
pegi kat link ni
http://www.go4expert.com/forums/showthread.php?t=2727
kat sini dia ckp differentiate all  mysql storage engines.
Reply

Use magic Report

Post time 9-8-2007 10:19 AM | Show all posts

Reply #12 zarcoss's post

keja copy mengcopy database (either tables are using innodb engine or not) ni sll sy buat, n tak de masalah pulak setakat ni.
either in linux or windows. u copy guna command ke or u ade guna tools?
Reply

Use magic Report

Post time 10-8-2007 10:24 PM | Show all posts
oo gitu..info yang berguna keychain... tapi awak tau tak tools apa yang bleh digunakan untuk dapatkan diagram bg db tu....
thanks
Reply

Use magic Report

Post time 13-8-2007 02:44 PM | Show all posts

Reply #15 mygirlz's post

so far, sy tak tau mana2 tools yg boleh dptkan diagram db yg kita dah create. tp sy pelik ngan soalan awak tu, nape dh ade db tu then baru nak dptkan diagramnya?
Reply

Use magic Report


ADVERTISEMENT


Post time 13-8-2007 06:21 PM | Show all posts

Reply #16 keychain's post

camni....memang sebelum create db kita da ada rangka table dan link semua...soalan saya ni sebenarnya...saya nak print diagram tu ....(untuk menyenangkan saya supaya takperlu saya nak buat box persemua lagi....)....
Reply

Use magic Report

Post time 14-8-2007 10:43 AM | Show all posts

Reply #17 mygirlz's post

aiseh....
kalo psl diagram2 ni, itu la pentingnya documentation...
ala...awak lukis je diagram tu then kasi clerk yg buat.. hehehehe..
kalo psl tools maybe awak leh tya ngan forummer lain.
sori ye...no idea la nk tlg bab ni..
Reply

Use magic Report

Post time 16-8-2007 09:19 AM | Show all posts
la.. ko cari jer  visio.. pastu lukis sendiri diagram tuh..
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

 

ADVERTISEMENT



 

ADVERTISEMENT


 


ADVERTISEMENT
Follow Us

ADVERTISEMENT


Mobile|Archiver|Mobile*default|About Us|CariDotMy

3-1-2025 01:03 AM GMT+8 , Processed in 0.099558 second(s), 38 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

Quick Reply To Top Return to the list