Yii Framework Forum: Join - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Join Rate Topic: -----

#1 User is offline   n-r 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 111
  • Joined: 19-April 13

Posted 09 May 2013 - 02:26 AM

hi friends
i have 3 table:

tb_user(sid, name,family){sid is primary key}
tb_tel(id,sid,tel){id is primary key --- sid is foriegn key}
tb_contact(idcontact,sid,name,family,tel,id){idcontact is primary key ---- sid is foriegn key}

now,I want define a foreign key in tb_contact(id) to the refers to ID in the tb_tel . but doing error!!

please help me!!
0

#2 User is offline   realtebo 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 620
  • Joined: 03-October 12
  • Location:Ferrara

Posted 10 May 2013 - 03:00 AM

[Not a reply] This is an italian speaking forum...
Il computer non ragiona, ma ha sempre ragione.
Ricordalo quando fai il debug
0

#3 User is offline   realtebo 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 620
  • Joined: 03-October 12
  • Location:Ferrara

Posted 10 May 2013 - 03:02 AM

View Postn-r, on 09 May 2013 - 02:26 AM, said:

hi friends
i have 3 table:

tb_user(sid, name,family){sid is primary key}
tb_tel(id,sid,tel){id is primary key --- sid is foriegn key}
tb_contact(idcontact,sid,name,family,tel,id){idcontact is primary key ---- sid is foriegn key}

now,I want define a foreign key in tb_contact(id) to the refers to ID in the tb_tel . but doing error!!

please help me!!


What do you mean by 'doing error' ? Do you have a SQL error, a PHP error o 'simply doesn't work'? Can you post you "relations" code?

Cosa intendi con 'doing error'? E' un errore SQL, PHP o "semplicemente non va" ?
Puoi postare il codice della function relations per favore ?
Il computer non ragiona, ma ha sempre ragione.
Ricordalo quando fai il debug
0

#4 User is offline   n-r 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 111
  • Joined: 19-April 13

Posted 10 May 2013 - 11:08 PM

View Postrealtebo, on 10 May 2013 - 03:02 AM, said:

What do you mean by 'doing error' ? Do you have a SQL error, a PHP error o 'simply doesn't work'? Can you post you "relations" code?

Cosa intendi con 'doing error'? E' un errore SQL, PHP o "semplicemente non va" ?
Puoi postare il codice della function relations per favore ?



hi dear friend
1- i'm iranian ,not Italian.
2- sql error.
3- thanks for your replay, i found this Answer.
thanks
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users