Jump to content
php.lv forumi

Palidzat mysql view


UnlikePC

Recommended Posts

Piemeram gribu savienot triis tabulas - lietotaji,pasutijumi un pasutijumu_rekveziti.

 

Tabula lietotaji :

 

id

Vards

Uzvards

pass

 

Tabula pasutijumi :

 

id

Datums

lietotaja_id

 

Tabula pasutijumu_rekveziti :

 

pasutijuma_id

preces_id

daudzums

Cena

 

Veletos lai view izkatitos sads :

 

Datums Preces nosaukums Preces cena Daudzums Cena

 

Piemeram lietotajs ar id = 19 skatas savu pirkuma vesturi. Atlasa ierakstus tabulaa pasutijumi kur lietotaja_id = ar id kas ir lietotaji tabulaa. Un tabulaa pasutijumu_rekveziti atlasa pec pasutijuma_id.

Cik sapratu ka primaro atslegu pasutijumu_rekveziti nav obligati taisit.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...