willirl
Založený: 04.04.2004
Príspevky: 14
Zaslal: 2004-04-04 20:50
Návrat hore
Odpovedať s citátom
|
I have read the docs and looked through the several postings here that related to this and understood none of them. I can't seem to make anything work.
I have two tables COST and ITEMS.
Table COST has fields: ID (key) and some others.
Table ITEMS has fields: ID (key), NAME, and some others.
While displaying table COST, I want to ADD a column that displays the value of NAME from the ITEMS table.
Can someone PLEASE post showing how this is done?
Getting frustrated,
Richard
|
michal
Založený: 17.06.2003
Príspevky: 537
Bydlisko: Slovakia
Zaslal: 2004-04-05 21:07
Návrat hore
Odpovedať s citátom
|
http://opensource.platon.sk/projects/doc.php/phpMyEdit/html/configuration.input-restrictions.html#AEN816
'col_name' is your foreign key in table cost
'table' is items
'id' is id
'description' is name
|
willirl
Založený: 04.04.2004
Príspevky: 14
Zaslal: 2004-04-05 23:04
Návrat hore
Odpovedať s citátom
|
Brief problem description:
Two tables. Columns of interest:
cost.id
items.id
items.name
I want a NEW display column while showing the cost table that shows the items.name column.
----------------------------------------
Your solution:
| Citácia: |
'col_name' is your foreign key in table cost
'table' is items
'id' is id
'description' is name
|
As I said before, I read the example and could not figure it out. It would be more helpful if you put the tested code here WITH the actual table and column names?
Is this what you mean:
| Kód: |
// ORIGINAL CODE
$opts['fdd']['id'] = array(
'name' => 'ID',
'select' => 'T',
'maxlen' => 10,
'required' => true,
'sort' => true
);
// NEW LINES FOLLOW
$opts['fdd']['id']['values']['table'] = 'items';
$opts['fdd']['id']['values']['column'] = 'id';
$opts['fdd']['id']['values']['description']['columns'][0] = 'name';
|
This does nothing different from the code WITHOUT the three new lines.
Also this isn't going to ADD a NEW column that shows the items.name column. It seems to be trying to change the cost.id column which is NOT what I want to do.
|
michal
Založený: 17.06.2003
Príspevky: 537
Bydlisko: Slovakia
Zaslal: 2004-04-06 08:42
Návrat hore
Odpovedať s citátom
|
are you trying to make something similar to http://opensource.platon.sk/forum/projects/viewtopic.php?t=348 ?
'values' option just changes value of a foreign key to corresponding in another table. so the column must already exist.
'sql' option can be used to "create" extra fields.
|
willirl
Založený: 04.04.2004
Príspevky: 14
Zaslal: 2004-04-06 12:56
Návrat hore
Odpovedať s citátom
|
Yes, I think this is what I'm trying to do. Obviously from the URL reference you gave this is not something that is easily understood.
Can you give a concrete working example of how this is accomplished?
|
michal
Založený: 17.06.2003
Príspevky: 537
Bydlisko: Slovakia
Zaslal: 2004-04-06 17:00
Návrat hore
Odpovedať s citátom
|
i've posted a possible solution at the above link, so let's continue discussion there.
|
willirl
Založený: 04.04.2004
Príspevky: 14
Zaslal: 2004-04-06 23:26
Návrat hore
Odpovedať s citátom
|
Which link?
|
michal
Založený: 17.06.2003
Príspevky: 537
Bydlisko: Slovakia
Zaslal: 2004-04-07 15:19
Návrat hore
Odpovedať s citátom
|
to all:
discussion is continued here:
http://opensource.platon.sk/forum/projects/viewtopic.php?t=348
|
michal
Založený: 17.06.2003
Príspevky: 537
Bydlisko: Slovakia
Zaslal: 2004-04-08 23:35
Návrat hore
Odpovedať s citátom
|
what is the relation between cost and items table ? in the cost table, there must be some item_number field, otherwise there is no connection between these two table. cost.item_number = item.id . so what's the name of this field ?
|
|
Odoslať novú tému
Odpovedať na tému
|