This topic is locked

Listing Data from Table 1 in Table 2-Part of the same Project

2/8/2009 6:05:35 AM
PHPRunner General questions
S
simonedan author

I would like Data from the Table "_artiste_list.php" to be automatically listed in the Table "calcalendar_list.php". Both Tables make Part of the same Project, where Calendar Tampate is integrated.

Somebody helps with the Code.Thanks.

J
Jane 2/9/2009

Hi,
I suppose you need to tranfer all data from one table to another.

I recommend you to create update query and then execute it in the database directly.

S
simonedan author 2/10/2009

Halo Jane

Thanks for Help

I have committed a big Mistake, not completing my original Question.I have written just abot Tables and You have logically understand that I have 2 same Tables.

2 Tables have are completely different.Therefor It should not be possible to transfer all Data from one Table to another.I am not neither interested in that.

I would like Data from the Table called "_artiste" -Filed "inizio lavoro" (date)
Field Type Collation Attributes Null Default Extra Action

nome varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

cognome varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

nazionalita varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

anno nascita date
Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

altezza varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

peso varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

seno varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

vita varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

fianchi varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

www varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

mese foto varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

anno foto varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

figurante di sala varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

giorni settmanali di lavoro varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

luogo varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

inizio lavoro date
Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

preferenze luogo lavoro varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

preferenze regione di lavoro varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

luogo,regione di lavoro tassativa varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

vuole lavorare a firenze varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

esperienze di lavoro varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

ID int(11)
No

auto_increment Browse distinct values Change Drop Primary Unique Index Fulltext

email varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

cellulare varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

telefono varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

italiano varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

periodo di lavoro varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

fotka1 varchar(100) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

foto2 varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

foto3 varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

interessata a lavorare al mare varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

interessata a lavorare in entroterra varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

se non eu ha il permesso di lavoro varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

comento varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

ingaggio varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

disponibilita varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

prenotazioni varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

pagamenti varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

arrivo esatto varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

conferma prenotazione varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

sviluppi varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

ingaggio x localita mare varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

picture mediumblob

BINARY Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

thumbnail mediumblob

BINARY Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

condizioni varchar(80) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

picture2 varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

picture4 varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

picture5 varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

picture6 varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

picture3 varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

inglese varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

giorno del inizio lavoro date
Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

altre lingue varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

NazionalitaAltro varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext
to be listed in Calendar Template Table

called "calcalendar", in the "Datefield"(date):
Field Type Collation Attributes Null Default Extra Action

id int(11)
No

auto_increment Browse distinct values Change Drop Primary Unique Index Fulltext

DateField date
Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

Description text latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

Theme varchar(200) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

TimeField varchar(15) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

EndTime varchar(15) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

DayEvent int(11)
Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

EndDate date
Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

Period varchar(255) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

Recurrence int(11)
Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

Category int(11)
Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

LugoArrivo varchar(50) latin1_swedish_ci

Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext

DataInizioLavoro date
Yes NULL

Browse distinct values Change Drop Primary Unique Index Fulltext
Both Tables makes Part of the same Project.
My Idea is to dynamically extract Data from the Table "_artiste" Filed "inizio lavoro" and list them dynamically in the Table "calcalender" , Field "DateField"

When I say "dynamically" I understand the Data are dynamically loaded by users into the Table "_artiste" and what I need should be the Code to extract tehm from there and list them in the Table "calcalendar", Field "DateField".
In the same Project I have other view from the Table "calcalendar"-like "caldayly", "calweekly", "calmonthly", "calyearly"

If the requested Code dos not do the same Job-to list the same data automtically in all this different "Views" of the Table "calcalendar" I would need other Codes to the same Job-to list the same Data in all View of the Table "calcalendar".
I not at all know the Coding and probably make some Confusion and may be I am asking something impossible.
Thanks

hichem 2/10/2009

I am not sure I understand correctly but if you would like to extract data from 2 tables and display it on a list page then you can simply create a new view and change the sql. You need to select from the 2 tables and join these on a common field. The rest is all done nicely by PHPR for you.

Note that when you select a table or create a view in PHPR it only allows you to select 1 table, however you can change the sql and create a view based on many tables and any fields you want.

Here's an example

Assuming the following:

table1 has date1, field1

table 2 has date2, field2

You want a view to show date1, field1, field2
select t1.date1, t1.field1, t2.field2 from table1 t1, table2 t2 where t1.date1=t2.date2

Hope this helps

S
simonedan author 2/11/2009

I am not sure I understand correctly but if you would like to extract data from 2 tables and display it on a list page then you can simply create a new view and change the sql. You need to select from the 2 tables and join these on a common field. The rest is all done nicely by PHPR for you.

Note that when you select a table or create a view in PHPR it only allows you to select 1 table, however you can change the sql and create a view based on many tables and any fields you want.

Here's an example

Assuming the following:

table1 has date1, field1

table 2 has date2, field2

You want a view to show date1, field1, field2
select t1.date1, t1.field1, t2.field2 from table1 t1, table2 t2 where t1.date1=t2.date2

Hope this helps


Thanks for Suggestion, it sound interesting.The Problem is to try it one should translate that in a Code.I am non capable to do that.

If You are so kind I would authorize You to enter the Site e and manage such Controls.Other Solution-to e-mail to You exactly both Tables or anything other You might need.

Thanks anyway

hichem 2/12/2009

pls check your pm messages on this board for my reply