| Index
» Projects
» phpMyEdit
» Forum
» Making an upload URL link |
 |
texasnerd
Joined: 09 Jun 2009
Posts: 2
Posted: 2009-06-12 19:35
Back to top
Reply with quote
|
I am posting this to show a clearer description of how to join two tables and have an upload link. I am a beginner and I would have appreciated this spelled out for me. SQL CONCAT may be used in place of URL to build a link. This us user field is joining uploaded files by user via a join.
| Code: |
$main_table = 'users'; // alias of the main table
$join_table = 'upload'; // alias of the values table
$join_column = 'submitter'; // join column in the values table
$join_description = 'file'; // description column in the values table
$main_column = 'users'; // join column in the main table
$opts['fdd']['users'] = array(
'default' => '',
'input' => '',
'maxlen' => 30,
'name' => 'Uploaded Files',
'options' => 'ACPVDFL',
'required' => false,
'select' => '',
'size|ACP' => 30,
'URL' => 'http://localhost/site.../$link',
//'URLtarget' = '_blank',
//'URLdisplay' = '$value',
'sql|w' => 'TRIM("$val_as")',
'sort' => true,
'values' => array(
'join' => '$main_table.$main_column = $join_table.$join_column',
'table' => 'upload',
'column' => 'submitter',
'description' => array(
'columns' => array($join_description)
)
)
); |
|
|
Post new topic
Reply to topic
|
|
|
|