Repeat region

Répondre


Cette question est un moyen d’empêcher des soumissions automatisées de formulaires par des robots.
Smileys
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: =D> #-o =P~ :^o :non: :priere: 8-|
Voir plus de smileys
  Revue du sujet
 

  Étendre la vue Revue du sujet : Repeat region

Re: Repeat region

par Calimero » 18 mai 2010, 22:48

Hello Andrej,

What do you need in order to do that ? Pure SQL or PHP code ? And what RDBMS are you using ?

In theory, the difficult part is getting this recordset from the database, that can be done quite easily with a simple joined query between the two tables through the COMPANY_ID common field (Primary key on the first table, Foreign key on the other one).

Something like that should do it :
SELECT * 
FROM COMPANY, AGENDA 
WHERE COMPANY.COMPANY_ID = AGENDA.COMPANY_ID
The php part is pretty straightforward really, and you can find good examples of it on any decent PHP resource available on the web, including the must-read php manual : http://php.net/mysql_query . (We could link you to several good resources to learn from though, but they'd all be written in french !).

Hope this helps. Please consider learning french if you intend to post on this forum in the future, if you want to take full advantage of it.

Re: Repeat region

par zeus » 18 mai 2010, 22:25

Hello.

Welcome to PHPFrance's forums.
I must warn you that we are a french forum, and you may not have many answers to an english question, and you can certainly find more appropriate english forums on the net.

Wishing you good luck.

Repeat region

par Andrej » 17 mai 2010, 13:49

Helo
I have two table:
COMPANY and AGENDA
Example Tbl COMPANY
COMPANY_ID
RAISONSOCIALE
Tbl AGENDA
AGENDA_ID
COMPANY_ID
Date_evenement
Titre

So I want display repeat region sommething like this:
---------------------------------------------------------------------------------------------
RAISONSOCIALE , Company_id 1
Agenda.Date, Agenda.titre ( all records by company_id 1 )
RAISONSOCIALE , Company_id 2
Agenda.Date, Agenda.titre ( all records by company_id 2 )

Thanks in advance

Andrej