| Index
» Projects
» phpMyEdit
» Forum
» joins - which do you recommend |
 |
BrentNJ
Joined: 03 Jun 2004
Posts: 12
Posted: 2004-06-03 18:35
Back to top
Reply with quote
|
Hi,
I found a few choices for joins
My tables
mos_users with many fields including states_id
states with fields states_id and state
***************************************************
1) tried this but columns are blank
$opts['fdd']['states_id'] = array(
'name' => 'state id',
'select' => 'T',
'maxlen' => 11,
'default' => '0',
'required' => true,
'foreign' => array( 'table' => 'states', 'column' => 'states_id' ),
'sort' => true
);
$opts['fdd']['state'] = array(
'name' => 'state',
'select' => 'T',
'input' => 'V',
'maxlen' => 40,
'sort' => true,
'sql' => 'PMEjoin0.state'
);
// Now important call to phpMyEdit
require_once 'extensions/phpMyEdit-foreign.class.php';
new phpMyEdit_foreign($opts);
*************************************************
2) found this at http://opensource.platon.sk/forum/projects/viewtopic.php?t=396
but not sure of syntax
$opts['fdd']['vendor']['values']['join'] = 'PMEjoin6.part_no = PMEtable0.part_no AND is_preferred = "TRUE" ';
***************************************************
3) found this at http://opensource.platon.sk/projects/bug_view_advanced_page.php?f_bug_id=218
but couldn't get to work
To create a join:
$opts['fdd']['stop_id'] = array(
'name' => 'Stop ID',
'select' => 'T',
'maxlen' => 11,
'default' => '0',
'required' => true,
'join' => array( 'table' => 'stop', 'column' => 'stop_id' ),
'sort' => true
);
To use joined fields:
$opts['fdd']['Street'] = array(
'name' => 'Street',
'select' => 'T',
'input' => 'V',
'maxlen' => 40,
'sort' => true,
'sql' => 'PMEjoin1.Street'
);
Joined fields are read-only.
************************************************8
Thanks!!
|
hbernard
Joined: 23 Mar 2003
Posts: 159
Location: FRANCE
Posted: 2004-06-11 09:05
Back to top
Reply with quote
|
I don't understand.
Which table is the main table you want to manage ?
_________________ hbernard - phpMyEdit updater.
|
BrentNJ
Joined: 03 Jun 2004
Posts: 12
Posted: 2004-06-11 13:14
Back to top
Reply with quote
|
I posted a more specific question. The response helped me understand the obvious.
Please disregard this question.
Thanks!!
|
|
Post new topic
Reply to topic
|
|
|
|